#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ull = unsigned long long; using ll = long long; int main() { string A; string B; cin >> A >> B; int data1[3] = {}; int data2[3] = {}; string tmp = ""; int count = 0; for(int i = 0; i < A.size(); ++i) { if(A.at(i) == '.') { data1[count] = stoi(tmp); ++count; tmp = ""; } else tmp += A.at(i); } data1[2] = stoi(tmp); tmp = ""; count = 0; for(int i = 0; i < B.size(); ++i) { if(B.at(i) == '.') { data2[count] = stoi(tmp); ++count; tmp = ""; } else tmp += B.at(i); } data2[2] = stoi(tmp); if(data1[0] < data2[0]) cout << "NO" << endl; else if(data1[0] > data2[0]) cout << "YES" << endl; else if(data1[1] < data2[1]) cout << "NO" << endl; else if(data1[1] > data2[1]) cout << "YES" << endl; else if(data1[2] < data2[2]) cout << "NO" << endl; else cout << "YES" << endl; }