#include #define fastIO (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false)) #define precise(i) fixed << setprecision(i) #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; vector convert(string version) { cerr << "version" << '\n'; vector temp; size_t prev = 0; for (size_t i = 0; i < version.size(); ++i) { if (version[i] == '.') { string t = version.substr(prev, i - prev); temp.emplace_back(stoi(t)); prev = ++i; } } temp.emplace_back(stoi(version.substr(prev))); return temp; } int main() { fastIO; string f, c; cin >> f >> c; vector f_ver = convert(f); vector c_ver = convert(c); for (int i = 0; i < 3; ++i) { if (f_ver[i] > c_ver[i]) { cout << "YES" << '\n'; return 0; } else if (f_ver[i] < c_ver[i]) { cout << "NO" << '\n'; return 0; } } cout << "YES" << '\n'; return 0; }