#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 using namespace std; int main() { char a[6]; char temp; for (int i = 0; i < 6; i++) { cin.get(a[i]); cin.get(temp); } 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; }