#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 ) ) { S = S + '.'; size_t pos = 0; string tmp; for( size_t i = pos; i < S.size(); i++ ) { pos = S.find_first_of( '.' , i ); tmp = S.substr( i, pos - i ); str.push_back( stoi( tmp ) ); i += ( pos - i ); } } REP( i, 3 ){ if( str[ i ] != str[ i + 3 ] ) { if( str[ i ] <= str[ i + 3 ] ) { cout << "NO" << endl; return 0; } } } cout << "YES" << endl; return 0; }