#include #include #include #include #include #include #include #include #include #include #include #include #define FOR(i, a, b) for(int i=(a);i<=(b);i++) #define RFOR(i, a, b) for(int i=(a);i>=(b);i--) #define MOD 1000000007 #define INF 1000000000 using namespace std; int main(void) { int a[3], b[3]; scanf("%d.%d.%d", &a[0], &a[1], &a[2]); scanf("%d.%d.%d", &b[0], &b[1], &b[2]); if (a[0] == b[0]) { if (a[1] == b[1]) { if (a[2] >= b[2]) { cout << "YES" << endl; } else { cout << "NO" << endl; } } else if (a[1] > b[1]) { cout << "YES" << endl; } else { cout << "NO" << endl; } } else if (a[0] > b[0]) { cout << "YES" << endl; } else { cout << "NO" << endl; } return 0; }