S = eval(input())

 

if S == 'AAA' or S == 'BBB': print('No')

else: print('Yes')
S = eval(input())

 

# AAAかBBBならNo、それ以外でYes

if S[0] == S[1] and S[1] == S[2]: print('No')

else: print('Yes')
S = eval(input())
if S == "AAA" or S == "BBB":
    print("No")
else:
    print("Yes")

S = eval(input())
# AAAかBBBならNo、それ以外でYes
if S[0] == S[1] and S[1] == S[2]:
    print("No")
else:
    print("Yes")

-if S == "AAA" or S == "BBB": +# AAAかBBBならNo、それ以外でYes +if S[0] == S[1] and S[1] == S[2]: