#include using namespace std; int main() { int a[3], b[3]; scanf("%d.%d.%d", a, a + 1, a + 2); scanf("%d.%d.%d", b, b + 1, b + 2); for (int i = 0; i < 3; i++) { if (a[i] < b[i]) { cout << "NO" << endl; return 0; } else if (a[i] > b[i]) { cout << "YES" << endl; return 0; } } cout << "YES" << endl; return 0; }