#include #define rep(i, a, n) for (int i = a; i < n; i++) #define repr(i, a, n) for (int i = n - 1; i >= a; i--) using namespace std; using ll = long long; using P = pair; template void chmin(T &a, T b) { a = min(a, b); } template void chmax(T &a, T b) { a = max(a, b); } vector split(const string &s, char delim) { vector elems; stringstream ss(s); string item; while (getline(ss, item, delim)) { if (!item.empty()) { elems.push_back(stoi(item)); } } return elems; } int main() { ios::sync_with_stdio(false); cin.tie(0); string one, two; cin >> one >> two; vector v1 = split(one, '.'), v2 = split(two, '.'); if (v1[0] > v2[0] || v1[1] > v2[1] || v1[2] > v2[2]) cout << "YES" << endl; else cout << "NO" << endl; }