s = list(eval(input()))



if 'A' not in s or 'B' not in s:

    print('No')

else:

    print('Yes')

s = eval(input())



if s[0] != s[1] or s[1] != s[2]:

	print('Yes')

else:

	print('No')

s = list(eval(input()))
if "A" not in s or "B" not in s:
    print("No")
else:
    print("Yes")

s = eval(input())
if s[0] != s[1] or s[1] != s[2]:
    print("Yes")
else:
    print("No")

-s = list(eval(input())) -if "A" not in s or "B" not in s: +s = eval(input()) +if s[0] != s[1] or s[1] != s[2]: +    print("Yes") +else: -else: -    print("Yes")