import copy
A=list(map(int,input().split()))
B=list(map(int,input().split()))
ans='No'
for i in range(3):
for j in range(3):
a=copy.deepcopy(A)
b=copy.deepcopy(B)
a[i],b[j]=b[j],a[i]
if ((a[0]a[2] and a[0]!=a[2]) or (a[0]>a[1] and a[1]b[2] and b[0]!=b[2]) or (b[0]>b[1] and b[1]