s=eval(input())

t=eval(input())

import sys

for i in range(len(s)):

    if s[i]==t[i]:

        pass

    else:

        print("No")

        sys.exit()

print('Yes')
a=eval(input())

b=eval(input())

import sys

for i in range(len(a)):

    if a[i]==b[i]:

        pass

    else:

        print("No")

        sys.exit()

print('Yes')

s = eval(input())
t = eval(input())
import sys

for i in range(len(s)):
    if s[i] == t[i]:
        pass
    else:
        print("No")
        sys.exit()
print("Yes")

a = eval(input())
b = eval(input())
import sys

for i in range(len(a)):
    if a[i] == b[i]:
        pass
    else:
        print("No")
        sys.exit()
print("Yes")

-s = eval(input()) -t = eval(input()) +a = eval(input()) +b = eval(input()) -for i in range(len(s)): -    if s[i] == t[i]: +for i in range(len(a)): +    if a[i] == b[i]: