#include #define rep(i,a,n) for (int i = a;i < n;i++) #define per(i,n,a) for (int i = n-1;i >= a;i--) 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 * 1000000 + b0 * 1000 + c0 >= a1 * 1000000 + b1 * 1000 + c1){ cout << "YES" << endl; }else{ cout << "NO" << endl; } }