#include #include using namespace std; int main() { int a1, a2, a3; int b1, b2, b3; cin >> a1; cin.ignore(); cin >> a2; cin.ignore(); cin >> a3; cin.ignore(); cin >> b1; cin.ignore(); cin >> b2; cin.ignore(); cin >> b3; cin.ignore(); if (a1 != b1) { (a1 > b1 ? cout << "YES" << endl : cout << "NO" << endl); } else { if (a2 != b2) { (a2 > b2 ? cout << "YES" << endl : cout << "NO" << endl); } else { if (a3 != b3) { (a3 > b3 ? cout << "YES" << endl : cout << "NO" << endl); } else { cout << "YES" << endl; } } } return 0; }