S=eval(input())



judge=True

for i in range(4):

  counter=int(0)

  for j in range(4):

    if S[i]==S[j]:

      counter+=1

      

  if counter!=2:

    judge=False

    

if judge:

  print('Yes')

else:

  print('No')
s=eval(input())

output='Yes'

for i in range(4):

  counter=0

  for j in range(4):

    if s[i]==s[j]:

      counter+=1

      

  if counter!=2:

    output='No'

    

print(output)
S = eval(input())
judge = True
for i in range(4):
    counter = int(0)
    for j in range(4):
        if S[i] == S[j]:
            counter += 1
    if counter != 2:
        judge = False
if judge:
    print("Yes")
else:
    print("No")

s = eval(input())
output = "Yes"
for i in range(4):
    counter = 0
    for j in range(4):
        if s[i] == s[j]:
            counter += 1
    if counter != 2:
        output = "No"
print(output)

-S = eval(input()) -judge = True +s = eval(input()) +output = "Yes" -    counter = int(0) +    counter = 0 -        if S[i] == S[j]: +        if s[i] == s[j]: -        judge = False -if judge: -    print("Yes") -else: -    print("No") +        output = "No" +print(output)