#include using namespace std; int main(){ string S1, S2; cin >> S1 >> S2; string var1_1 = "", var1_2 = "", var1_3 = "", var2_1 = "", var2_2 = "", var2_3 = ""; int now1 = 0; int now2 = 0; for(int i = 0; i < S1.size(); i++){ if(S1[i] == '.'){ now1++; }else if(now1 == 0){ var1_1.push_back(S1[i]); }else if(now1 == 1){ var1_2.push_back(S1[i]); }else if(now1 == 2){ var1_3.push_back(S1[i]); } if(S2[i] == '.'){ now2++; }else if(now2 == 0){ var2_1.push_back(S2[i]); }else if(now2 == 1){ var2_2.push_back(S2[i]); }else if(now2 == 2){ var2_3.push_back(S2[i]); } } if(stoi(var1_1) > stoi(var2_1) || ((stoi(var1_1) == stoi(var2_1)) && (stoi(var1_2) > stoi(var2_2))) || ((stoi(var1_1) == stoi(var2_1)) && (stoi(var1_2) == stoi(var2_2)) && (stoi(var1_3) >= stoi(var2_3)))){ cout << "YES" << endl; }else{ cout << "NO" << endl; } }