a, b = io.read("*n", "*n") c, d = io.read("*n", "*n") print(a < b and d < c and "YES" or "NO")