S = eval(input())

if S[0] == S[1] == S[2]:

    print("No")

else:

    print("Yes")

S = list(eval(input()))



#print(set(S))

setS = set(S)



if len(setS) == 2:

    print("Yes")

else:

    print("No")

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

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

-S = eval(input()) -if S[0] == S[1] == S[2]: +S = list(eval(input())) +# print(set(S)) +setS = set(S) +if len(setS) == 2: +    print("Yes") +else: -else: -    print("Yes")