#include using namespace std; int Len( const char *A ) { int i; i = 0; while( A[ i ] != '.' && A[ i ] != '\0' ) i++; return i; } int Chk( const char *A, const char *B ) { int i; int iA; int iB; iA = Len( A ); iB = Len( B ); if( iA < iB ) { cout << "NO" << endl; return - 1; } else if( iA > iB ) { cout << "YES" << endl; return - 1; } for( i = 0; i < iA; i++ ) { if( A[ i ] == B[ i ] ) continue; else if( A[ i ] < B[ i ] ) { cout << "NO" << endl; return - 1; } else { cout << "YES" << endl; return - 1; } } return iA; } int main() { int iPos; int iLen; char S[ 50 ]; char T[ 50 ]; cin >> S; cin >> T; iPos = 0; do { iLen = Chk( S, T ); if( iLen < 0 ) break; iPos += iLen; iPos++; iLen = Chk( S, T ); if( iLen < 0 ) break; iPos += iLen; iPos++; iLen = Chk( S, T ); if( iLen < 0 ) break; cout << "YES" << endl; return 0; } while( false ); return 0; }