import sys readline=sys.stdin.readline def check(lst): if len(set(lst))==3 and lst[1] in (min(lst),max(lst)): return True return False A=list(map(int,readline().split())) B=list(map(int,readline().split())) ans="No" for i in range(3): for j in range(3): A[i],B[j]=B[j],A[i] if check(A) and check(B): ans="Yes" A[i],B[j]=B[j],A[i] print(ans)