import itertools def is_valid(perm): for i in range(len(perm) - 2): a, b, c = perm[i], perm[i+1], perm[i+2] if a == b or b == c or a == c: return False if a >= c: return False is_max = b > a and b > c is_min = b < a and b < c if not (is_max or is_min): return False return True D = list(map(int, input().split())) found = False # Generate all unique permutations unique_perms = list(set(itertools.permutations(D))) for perm in unique_perms: if is_valid(perm): found = True break print("YES" if found else "NO")