def k(a):return 1<0 if a[0]==a[1]or a[1]==a[2]or a[2]==a[0]else max(a)==a[1]or min(a)==a[1] a=list(map(int,input().split())) b=list(map(int,input().split())) for i in range(3): for j in range(3): a[i],b[j]=b[j],a[i] if k(a)and k(b): print('Yes') exit() a[i],b[j]=b[j],a[i] print('No')