S=set(eval(input()))

print(("Yes" if len(S)==2 else "No"))
S = [c for c in eval(input())]

print(("Yes" if len(set(S))==2 else "No"))
S = set(eval(input()))
print(("Yes" if len(S) == 2 else "No"))

S = [c for c in eval(input())]
print(("Yes" if len(set(S)) == 2 else "No"))

-S = set(eval(input())) -print(("Yes" if len(S) == 2 else "No")) +S = [c for c in eval(input())] +print(("Yes" if len(set(S)) == 2 else "No"))