s=list(eval(input()))

if len(set(s))==2:

    print("Yes")

else:

    print("No")

if eval(input()) in ["AAA","BBB"]:

  print("No")

else:

  print("Yes")
s = list(eval(input()))
if len(set(s)) == 2:
    print("Yes")
else:
    print("No")

if eval(input()) in ["AAA", "BBB"]:
    print("No")
else:
    print("Yes")

-s = list(eval(input())) -if len(set(s)) == 2: +if eval(input()) in ["AAA", "BBB"]: +    print("No") +else: -else: -    print("No")