S=eval(input())

if S == "AAA" or S == "BBB":

  print("No")

else:

  print("Yes")
s=eval(input())

if s=="AAA" or s=="BBB":

  print("No")

else:

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

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

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