#include //cin, cout #include //vector #include //sort,min,max #include //string #include //fixed #include //setprecision #include //swap #include //abs(int) #include //sqrt #include //stringstream,getline using namespace std; inline std::vector Split_String(const std::string& str, const char key) { std::vector result; std::stringstream SS(str); std::string temp; while (std::getline(SS, temp, key)) { result.push_back(temp); } return(result); } int main() { vector A, B; string temp; cin >> temp; A = Split_String(temp, '.'); cin >> temp; B = Split_String(temp, '.'); int a1 = stoi(A[0]), b1 = stoi(A[1]), c1 = stoi(A[2]); int a2 = stoi(B[0]), b2 = stoi(B[1]), c2 = stoi(B[2]); bool flg = true; if (a2 > a1) { flg = false; } else if (a2 == a1) { if (b2 > b1) { flg = false; } else if (b2 == b1) { if (c2 > c1) { flg = false; } } } if (flg) { cout << "YES" << endl; } else { cout << "NO" << endl; } return 0; }