#include #include struct Version { int major, minor, patch; }; bool operator<(const Version &fossil, const Version &v) { if (fossil.major != v.major) { return fossil.major < v.major; } else if (fossil.minor != v.minor) { return fossil.minor < v.minor; } else { return fossil.patch < v.patch; } } Version to_ver(std::string v) { auto idx = v.find('.'); auto major = v.substr(0, idx); v = v.substr(idx + 1); idx = v.find('.'); auto minor = v.substr(0, idx); auto patch = v.substr(idx + 1); return Version{ std::stoi(major), std::stoi(minor), std::stoi(patch) }; } int main() { std::string fossil, ver; std::cin >> fossil >> ver; if (to_ver(fossil) < to_ver(ver)) { std::cout << "NO\n"; } else { std::cout << "YES\n"; } return 0; }