#define _GLIBCXX_DEBUG #include #define rep(i, n) for (int i = 0; i < (int)n; i++) #define repp(i, m, n) for (int i = (int)m; i < (int)n; i++) #define all(v) begin(v), end(v) using namespace std; using ll = long long int; vector split(string s) { vector v; string t = ""; for (const auto& c : s) { if (c != '.') { t += c; } else { v.push_back(stoi(t)); t = ""; } } if (t != "") v.push_back(stoi(t)); return v; } int main() { // 入力 string S, T; cin >> S >> T; vector A = split(S), a = split(T); // 判定 bool isFuel = true; if (a[0] < A[0]) { isFuel = true; } else if (a[0] > A[0]) { isFuel = false; } else { if (a[1] < A[1]) { isFuel = true; } else if (a[1] > A[1]) { isFuel = false; } else { if (a[2] < A[2]) { isFuel = true; } else if (a[2] > A[2]) { isFuel = false; } else { isFuel = true; } } } // 出力 cout << (isFuel ? "YES" : "NO") << endl; }