x=list(map(int,input().split())) y=0 for i in x: if i==x[2] or i==x[5]: y+=0 else: y+=1 if y>=1: print ("YES") else: print ("NO")