#yuki1366 def f(s): x=s[0] y=s[1] z=s[2] if (x<y>z or x>y<z) and (x!=z): return True return False 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 f(a) and f(b): print('Yes') exit() a[i],b[j]=b[j],a[i] print('No')