#include //cin, cout #include //vector #include //sort,min,max,count #include //string,getline, to_string #include //abs(int) #include //swap, pair #include //deque #include //INT_MAX #include //bitset #include //sqrt, ceil. M_PI, pow, sin #include //fixed #include //setprecision #include //stringstream using namespace std; inline vector Split_String(const string& str, const char key) { vector result; stringstream SS(str); string temp; while (getline(SS, temp, key)) { result.push_back(temp); } return(result); } int main() { string S1, S2; cin >> S1 >> S2; vector A = Split_String(S1, '.'); vector B = Split_String(S2, '.'); vector a(6); a[0] = stoi(A[0]); a[1] = stoi(A[1]); a[2] = stoi(A[2]); a[3] = stoi(B[0]); a[4] = stoi(B[1]); a[5] = stoi(B[2]); if (a[3] < a[0]) { cout << "YES" << endl; } else if (a[3] > a[0]) { cout << "NO" << endl; } else { if (a[4] < a[1]) { cout << "YES" << endl; } else if (a[4] > a[1]) { cout << "NO" << endl; } else { if (a[5] <= a[2]) { cout << "YES" << endl; } else { cout << "NO" << endl; } } } return 0; }