#define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define eps 0.000000001 #define LONG_INF 10000000000000000 #define GOLD 1.61803398874989484820458 #define MAX_MOD 1000000007 #define MOD 998244353 #define seg_size 65536*2 #define REP(i,n) for(long long i = 0;i < n;++i) #define cycle_per_sec 2806192512 int main() { int a, b, c, d, e, f; scanf("%d.%d.%d", &a, &b, &c); scanf("%d.%d.%d", &d, &e, &f); if (a <= d) { if (a < d) { cout << "NO" << endl; } else { if (b <= e) { if (b < e) cout << "NO" << endl; else { if (c >= f) { cout << "YES" << endl; } else cout << "NO" << endl; } } else cout << "YES" << endl; } } else cout << "YES" << endl; return 0; }