#include int main(void) { int a[2], b[2], c[2]; for (int i = 0; i < 2; i++) scanf("%d.%d.%d", &a[i], &b[i], &c[i]); puts(a[0] * 100 + b[0] * 10 + c[0] >= a[1] * 100 + b[1] * 10 + c[1] ? "YES" : "NO"); return 0; }