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] * 10000 + B[0] * 100 + C[0] >= A[1] * 10000 + B[1] * 100 + C[1] ? "YES" : "NO").writeln; }