import std.stdio, std.conv, std.string, std.range, std.math, std.algorithm; void main() { int[] A, B, C; foreach (line; stdin.byLineCopy.array) { auto input = line.split(".").to!(int[]); A ~= input[0]; B ~= input[1]; C ~= input[2]; } ( A[0] * 10101 + B[0] * 101 + C[0] >= A[1] * 10101 + B[1] * 101 + C[1] ? "YES" : "NO").writeln; }