#include #include using namespace std; int main(int argc, const char* argv[]) { string ver1, ver2; cin >> ver1 >> ver2; for (auto&& c : ver1) if (c == '.') c = ' '; for (auto&& c : ver2) if (c == '.') c = ' '; stringstream s; s << ver1 << endl << ver2 << endl; int A[3], B[3]; for (auto&& a : A) s >> a; for (auto&& b : B) s >> b; for (int i = 0; i < 3; i++) { if (A[i] < B[i]) { cout << "NO" << endl; return 0; } if (A[i] > B[i]) break; } cout << "YES" << endl; return 0; }