#include #include #include #include #include #include #include #include #include #include using namespace std; int main(){ int a0, b0, c0, a1, b1, c1; char c; cin >> a0 >> c >> b0 >> c >> c0 >> a1 >> c >> b1 >> c >> c1; if (a0 > a1) cout << "YES" << endl; else if (a0 < a1) cout << "NO" << endl; else if (b0 > b1) cout << "YES" << endl; else if (b0 < b1) cout << "NO" << endl; else if (c0 >= c1) cout << "YES" << endl; else cout << "NO" << endl; }