S = list(i for i in eval(input()))



if 'A' in S and 'B' in S:

  print('Yes')

else:

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



S_list = [i for i in S]

S_set = set(S_list)



if len(S_set) == 2:

  print('Yes')

else:

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

S = eval(input())
S_list = [i for i in S]
S_set = set(S_list)
if len(S_set) == 2:
    print("Yes")
else:
    print("No")

-S = list(i for i in eval(input())) -if "A" in S and "B" in S: +S = eval(input()) +S_list = [i for i in S] +S_set = set(S_list) +if len(S_set) == 2: