#include using namespace std; int main() { vector v1(3), v2(3); for (int i = 0; i < 10; i++) { if (i < 5) { if (i == 1 || i == 3) { char c; cin >> c; } else { int n; cin >> n; v1.push_back(n); } } else { if (i == 6 || i == 8) { char c; cin >> c; } else { int n; cin >> n; v2.push_back(n); } } } if (v1 < v2) { cout << "NO" << endl; } else { cout << "YES" << endl; } }