#include #include #include #include #include #include #include #include using namespace std; int main() { int a[3], b[3]; char c; cin >> a[0] >> c >> a[1] >> c >> a[2]; cin >> b[0] >> c >> b[1] >> c >> b[2]; for (int i = 0; i < 3; i++) { if (a[i] == b[i])continue; else if (a[i]>b[i]) { cout << "YES" << endl; return 0; } else { cout << "NO" << endl; return 0; } } cout << "YES" << endl; return 0; }