def yesno(S):

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

    return "No"

  else:

    return "Yes"

S=eval(input())

print((yesno(S)))

s=eval(input())

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

  print("No")

else:

  print("Yes")
def yesno(S):
    if S == "AAA" or S == "BBB":
        return "No"
    else:
        return "Yes"


S = eval(input())
print((yesno(S)))

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

-def yesno(S): -    if S == "AAA" or S == "BBB": -        return "No" -    else: -        return "Yes" - - -S = eval(input()) -print((yesno(S))) +s = eval(input()) +if s == "AAA" or s == "BBB": +    print("No") +else: +    print("Yes")