data = eval(input())

if 'A' in data and 'B' in data:

  print('Yes')

else:

  print('No')
S = eval(input())

if ("A" in S) and ("B" in S):

    print("Yes")

else:

    print("No")
data = eval(input())
if "A" in data and "B" in data:
    print("Yes")
else:
    print("No")

S = eval(input())
if ("A" in S) and ("B" in S):
    print("Yes")
else:
    print("No")

-data = eval(input()) -if "A" in data and "B" in data: +S = eval(input()) +if ("A" in S) and ("B" in S):