#include using namespace std; int main(void) { int a, b, c, d, e, f; scanf("%d.%d.%d", &a, &b, &c); scanf("%d.%d.%d", &d, &e, &f); if(a*1000000+b*1000+c >= d*1000000+e*1000+f) { cout << "YES" << endl; } else { cout << "NO" << endl; } }