S = input().split()
for i in range(-1, 2):
    if S[i-1] == S[i] and S[i] != S[i+1]:
        print("Yes")
        exit()
else:
    print("No") S = input().split() S input().split() ().split () input split for i in range(-1, 2):
    if S[i-1] == S[i] and S[i] != S[i+1]:
        print("Yes")
        exit()
else:
    print("No") i range(-1, 2) range -1 2 if S[i-1] == S[i] and S[i] != S[i+1]:
        print("Yes")
        exit() S[i-1] == S[i] and S[i] != S[i+1] S[i-1] == S[i] S[i-1] S i-1 i 1 S[i] S i S[i] != S[i+1] S[i] S i S[i+1] S i+1 i 1 print("Yes") print "Yes" exit() exit print("No") print "No" S = input().split() input().split() S
S = input().split()
for i in range(-1, 2):
    if S[i-1] == S[i] and S[i] != S[i+1]:
        print("Yes")
        exit()
else:
    print("No")