#include #include using namespace std; int main() { string S0, S1; cin >> S0 >> S1; if(S0.erase(0, S0.find('.') - 1) > S1.erase(0, S1.find('.') - 1)) { cout << "YES" << endl; return 0; } if(S0.erase(S0.find('.') + 1, S0.rfind('.') - 1 - S0.find('.') + 1) > S1.erase(S1.find('.') + 1, S1.rfind('.') - 1 - S1.find('.') + 1)) { cout << "YES" << endl; return 0; } if(S0.erase(S0.rfind('.') + 1, S0.length() - S0.rfind('.') + 1) > S1.erase(S1.rfind('.') + 1, S1.length() - S1.rfind('.') + 1)) { cout << "YES" << endl; return 0; } cout << "NO" << endl; return 0; }