#include using namespace std; #define REP(i,n) for(int i=0; i<(n); i++) int main() { string S; vector str; while( getline( cin, S ) ) { size_t pos = 0; for( size_t i = pos; i < S.size(); i++ ) { pos = S.find_first_of( '.' , pos ); string tmp = S.substr( i, pos ); str.push_back( stoi(tmp) ); i += pos; } } if( str[0] < str[3] ) { cout << "NO" << endl; return 0; } else if( str[0] == str[3] ) { if( str[1] < str[4] ) { cout << "NO" << endl; return 0; } else if( str[1] == str[4] ) { if( str[2] < str[5] ) { cout << "NO" << endl; return 0; } } } cout << "YES" << endl; return 0; }