#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*100+b*10+c >= d*100+e*10+f) { cout << "YES" << endl; } else { cout << "NO" << endl; } }