#include #include #include #include #include #include #include #include using namespace std; int main(void){ int A0, B0, C0, A1, B1, C1; scanf("%d.%d.%d", &A0, &B0, &C0); scanf("%d.%d.%d", &A1, &B1, &C1); if(A0 > A1) { cout << "YES" << endl; }else if(A0 < A1){ cout << "NO" << endl; } if(A0 == A1){ if(B0 > B1) { cout << "YES" << endl; }else if(B0 < B1){ cout << "NO" << endl; } if(B0 == B1){ if(C0 > C1) { cout << "YES" << endl; }else if(C0 < C1){ cout << "NO" << endl; } } } return 0; }