S=eval(input())

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



    print('No')

else:

    print('Yes')

a=eval(input())



if(a=='AAA' or a=='BBB'):

    print('No')

else:

    print('Yes')

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

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

-S = eval(input()) -if S == "AAA" or S == "BBB": +a = eval(input()) +if a == "AAA" or a == "BBB":