n = int(input()) a,b,c = map(int,input().split()) if a == c or b == c: print("No") else: print("Yes")