ssss = list(eval(input()))

ans = {}



for s in ssss:

    if s in ans:

        ans[s] += 1

    else:

        ans[s] = 1

for s in ans:

    if ans[s] == 2:

        continue

    else:

        print('No')

        exit()

print('Yes')
S = list(eval(input()))

cnt = {}

for s in S:

    if s not in cnt:

        cnt[s] = 1

    else:

        cnt[s] += 1

for c in cnt:

    if cnt[c] != 2:

        print('No')

        exit()

print('Yes')

ssss = list(eval(input()))
ans = {}
for s in ssss:
    if s in ans:
        ans[s] += 1
    else:
        ans[s] = 1
for s in ans:
    if ans[s] == 2:
        continue
    else:
        print("No")
        exit()
print("Yes")

S = list(eval(input()))
cnt = {}
for s in S:
    if s not in cnt:
        cnt[s] = 1
    else:
        cnt[s] += 1
for c in cnt:
    if cnt[c] != 2:
        print("No")
        exit()
print("Yes")

-ssss = list(eval(input())) -ans = {} -for s in ssss: -    if s in ans: -        ans[s] += 1 +S = list(eval(input())) +cnt = {} +for s in S: +    if s not in cnt: +        cnt[s] = 1 -        ans[s] = 1 -for s in ans: -    if ans[s] == 2: -        continue -    else: +        cnt[s] += 1 +for c in cnt: +    if cnt[c] != 2: