#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; long long MOD = 1000000007; int main() { string S1,S2; cin >> S1 >> S2; bool is_new = false; for ( int i = 0; i < 4; i+=2 ) { if ( S2[i] > S1[i] ) { is_new = true; break; } } cout << ( is_new ? "NO" : "YES" ) << endl; return 0; }