# a=int(input())
# b=int(input())
# ih=max(a,b)
# if a>b:
#     in=a
# else:
#     ih=b
# print(ih)
# n=int(input())
# if n>100:
#     print(true)
# else:
#     print(fail)
#n=int(input())
#if n%3==0:
    #print(True)
#else:
 #   print(False)
#n=int(input())
#if n//7==0:
 #   print(n)
#else:
  #  n%7!=0
   # print(n%7)
# n=int(input())
# if n%3!=0:
#     print(n%3)
# else:
#    n//3==0
#    print(n//3)
# n=int(input())
# #bod7
# if n%2==0:
#     print(True)
# else:
#     n%2!=0
#     print(False)
# bod8
# n=int(input())
# if n%10%2==0:
#     print(True)
# else:
#     n%10%2!=0
#     print(False)
#bod9
# a=input()
# tom=a.upper()
# print(tom)
#bod10
# n=input()
# too=len(n)
# if too>5:
#     tom=n.upper()
#     print(tom)
# else:
#     print(n)
#bod11
# a,b,c=[int() for i in input().splint()]

# if a<b and a<c:
#     print(a)
# elif b<c and b<a:
#     print(b)
# else:
#     print(c)

















# bod14
x1,y1,x2,y2=[int(i) for i in input()]
if x1==x2 or y1==y2:
    print("yes")
else:
    print("no")

