def main(): S, T, c = input().split() S = int(input()) T = int(input()) if c == "<": print("YES" if S < T else "NO") elif c == ">": print("YES" if S > T else "NO") else: print("YES" if S == T else "NO") if __name__ == "__main__": main()