s = sorted(list(eval(input())))

print(("Yes" if s[0] == s[1] and s[2] == s[3] and s[1] != s[2] else "No"))
s = sorted(eval(input()))

print(("Yes" if s[0] == s[1] and s[2] == s[3] and s[1] != s[2] else "No"))
s = sorted(list(eval(input())))
print(("Yes" if s[0] == s[1] and s[2] == s[3] and s[1] != s[2] else "No"))

s = sorted(eval(input()))
print(("Yes" if s[0] == s[1] and s[2] == s[3] and s[1] != s[2] else "No"))

-s = sorted(list(eval(input()))) +s = sorted(eval(input()))