from itertools import * def kadomatsu(a, b, c): if a <= c: return False for i in [-1, 1]: if a * i < b * i and b * i > c * i and a != c: return True return False D = list(map(int, input().split())) ans = "NO" for tup in permutations(D): for i in range(5): if not kadomatsu(tup[i], tup[i + 1], tup[i + 2]): break else: ans = "YES" print(ans)