for _ in range(int(input())):
    s=input()
    if len(set(s))==1:
        print('Yes')
    else:
        print('Yes' if s.count('1')&s.count('0')%2==0 else 'No')