#include using namespace std; int main() { string S; vector str; while( getline( cin, S, '.' ) ) { istringstream ss( S ); int a; while ( ss >> a ) { str.push_back( a ); } } 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; }