def resolve():

    a = eval(input())

    if a =="AAA" or a == "BBB":

        print("No")

    else:

        print("Yes")

resolve()
s = eval(input())

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

	print("No")

else:

	print("Yes")
def resolve():
    a = eval(input())
    if a == "AAA" or a == "BBB":
        print("No")
    else:
        print("Yes")


resolve()

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

-def resolve(): -    a = eval(input()) -    if a == "AAA" or a == "BBB": -        print("No") -    else: -        print("Yes") - - -resolve() +s = eval(input()) +if s == "AAA" or s == "BBB": +    print("No") +else: +    print("Yes")