#include using namespace std; int main() { int a0, b0, c0; int a1, b1, c1; scanf("%d.%d.%d", &a0, &b0, &c0); scanf("%d.%d.%d", &a1, &b1, &c1); if (a0 < a1) { cout << "NO" << endl; exit(0); } else if (a0 > a1) { cout << "YES" << endl; exit(0); } if (b0 < b1) { cout << "NO" << endl; exit(0); } else if (b0 > b1) { cout << "YES" << endl; exit(0); } if (c0 < c1) { cout << "NO" << endl; exit(0); } cout << "YES" << endl; return 0; }