#include #include #include #include #include #include #include #include #include using namespace std; #define INIT cin.tie(0); ios::sync_with_stdio(false); #define FOR(i, a, n) for (int i = a; i < n; i++) #define REP(i, n) for(int i = 0; i < n; i++) int main() { INIT; char d; int A[3], B[3]; cin >> A[0] >> d >> A[1] >> d >> A[2]; cin >> B[0] >> d >> B[1] >> d >> B[2]; int a = 1000000 * A[0] + 1000 + A[1] + A[2]; int b = 1000000 * B[0] + 1000 + B[1] + B[2]; if(a > b or a == b) cout << "YES" << endl; else cout << "NO" << endl; return 0; }