#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { int A[2], B[2], C[2]; for (int i = 0; i < 2; i++) scanf("%d . %d . %d", &A[i], &B[i], &C[i]); bool flag = false; /* if (A[1] < A[0]) flag = true; if(B[1] < B[0] && A[1] == A[0]) flag = true; if(C[1] <= C[0] && B[1] == B[0] && A[1] == A[0]) flag = true; */ long long n1, n2; n1 = A[0] * 100000000 + B[0] * 1000 + C[0]; n2 = A[1] * 100000000 + B[1] * 1000 + C[1]; if (n1 >= n2) flag = true; if (flag) cout << "YES" << endl; else cout << "NO" << endl; return 0; }