a = eval(input())

a = sorted(a)



if a[0] == a[1] and a[2] == a[3] and a[1] != a[3]:

    print("Yes")

else:

    print("No")
a = sorted(input())

print("Yes") if a[0] == a[1] and a[2] == a[3] and a[1] != a[3] else print("No")

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

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

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