# -*- coding: utf-8 -*- """ Created on Sun Sep 26 17:30:25 2021 @author: 大翔 """ a,b,c=map(int,input().split()) d,e,f=map(int,input().split()) i=0 z=0 if a < b and b > c: if d < e and e > f: i=1 if d > e and e < f: i=1 if a > b and b < c: if d < e and e > f: i=1 if d > e and e < f: i=1 z=a a=d d=z if a < b and b > c: if d < e and e > f: i=1 if d > e and e < f: i=1 if a > b and b < c: if d < e and e > f: i=1 if d > e and e < f: i=1 z=a a=d d=z z=a a=e e=z if a < b and b > c: if d < e and e > f: i=1 if d > e and e < f: i=1 if a > b and b < c: if d < e and e > f: i=1 if d > e and e < f: i=1 z=a a=e e=z z=a a=f f=z if a < b and b > c: if d < e and e > f: i=1 if d > e and e < f: i=1 if a > b and b < c: if d < e and e > f: i=1 if d > e and e < f: i=1 z=a a=f f=z z=b b=d d=z if a < b and b > c: if d < e and e > f: i=1 if d > e and e < f: i=1 if a > b and b < c: if d < e and e > f: i=1 if d > e and e < f: i=1 z=b b=d d=z z=b b=e e=z if a < b and b > c: if d < e and e > f: i=1 if d > e and e < f: i=1 if a > b and b < c: if d < e and e > f: i=1 if d > e and e < f: i=1 z=b b=e e=z z=b b=f f=z if a < b and b > c: if d < e and e > f: i=1 if d > e and e < f: i=1 if a > b and b < c: if d < e and e > f: i=1 if d > e and e < f: i=1 z=b b=f f=z z=c c=d d=z if a < b and b > c: if d < e and e > f: i=1 if d > e and e < f: i=1 if a > b and b < c: if d < e and e > f: i=1 if d > e and e < f: i=1 z=c c=d d=z z=c c=e e=z if a < b and b > c: if d < e and e > f: i=1 if d > e and e < f: i=1 if a > b and b < c: if d < e and e > f: i=1 if d > e and e < f: i=1 z=c c=e e=z z=c c=f f=z if a < b and b > c: if d < e and e > f: i=1 if d > e and e < f: i=1 if a > b and b < c: if d < e and e > f: i=1 if d > e and e < f: i=1 z=c c=f f=z z=d d=e e=z if a < b and b > c: if d < e and e > f: i=1 if d > e and e < f: i=1 if a > b and b < c: if d < e and e > f: i=1 if d > e and e < f: i=1 z=d d=e e=z z=d d=f f=z if a < b and b > c: if d < e and e > f: i=1 if d > e and e < f: i=1 if a > b and b < c: if d < e and e > f: i=1 if d > e and e < f: i=1 z=d d=f f=z z=e e=f f=z if a < b and b > c: if d < e and e > f: i=1 if d > e and e < f: i=1 if a > b and b < c: if d < e and e > f: i=1 if d > e and e < f: i=1 if i == 1: print("Yes") else: print("No")