#include using namespace std; int main(){ string data1,data2; cin >> data1 >> data2; string tmp = ""; vector x; vector y; for(int i = 0; i < data1.size(); i++){ if(data1[i] != '.') tmp += data1[i]; else{ x.push_back(stoi(tmp)); tmp = ""; } } x.push_back(stoi(tmp)); tmp = ""; for(int i = 0; i < data2.size(); i++){ if(data2[i] != '.') tmp += data2[i]; else{ y.push_back(stoi(tmp)); tmp = ""; } } y.push_back(stoi(tmp)); for(int i = 0; i < 3; i++){ if(x[i] > y[i]){ cout << "YES" << endl; return 0; }else if(x[i] < y[i]){ cout << "NO" << endl; return 0; } } cout << "YES" << endl; return 0; }