#include using namespace std; #define ll long long int main() { int a0, b0, c0, a1, b1, c1; scanf("%d.%d.%d", &a0, &b0, &c0); scanf("%d.%d.%d", &a1, &b1, &c1); ll x0 = a0 * 1000000 + b0 * 1000 + c0; ll x1 = a1 * 1000000 + b1 * 1000 + c1; if (x1 <= x0) { cout << "YES" << endl; } else { cout << "NO" << endl; } return 0; }