import sys import math import collections import bisect # sys.setrecursionlimit(10000001) INF = 10 ** 20 # MOD = 10 ** 9 + 7 MOD = 998244353 def ni(): return int(sys.stdin.buffer.readline()) def ns(): return map(int, sys.stdin.buffer.readline().split()) def na(): return list(map(int, sys.stdin.buffer.readline().split())) def na1(): return list(map(lambda x: int(x)-1, sys.stdin.buffer.readline().split())) # ===CODE=== def main(): a = na() b = na() for i in range(3): for j in range(3): ta = a.copy() tb = b.copy() ta[i], tb[j] = tb[j], ta[i] f1 = ta[0] < ta[1] > ta[2] or ta[0] > ta[1] < ta[2] f2 = tb[0] < tb[1] > tb[2] or tb[0] > tb[1] < tb[2] f3 = len(set(ta)) == 3 and len(set(tb)) == 3 if f1 and f2 and f3: print("Yes") return print("No") if __name__ == '__main__': main()