/* -*- coding: utf-8 -*- * * 138.cc: No.138 化石のバージョン - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ /* typedef */ /* global variables */ /* subroutines */ void read_ver(string &s, int &a, int &b, int &c) { a = b = c = 0; int pos = 0; while (pos < s.size() && s[pos] != '.') a = 10 * a + s[pos++] - '0'; pos++; while (pos < s.size() && s[pos] != '.') b = 10 * b + s[pos++] - '0'; pos++; while (pos < s.size()) c = 10 * c + s[pos++] - '0'; } /* main */ int main() { string s0, s1; cin >> s0 >> s1; int a0, b0, c0, a1, b1, c1; read_ver(s0, a0, b0, c0); read_ver(s1, a1, b1, c1); //printf("%d.%d.%d <-> %d.%d.%d\n", a0, b0, c0, a1, b1, c1); bool ans = a0 > a1 || (a0 == a1 && (b0 > b1 || (b0 == b1 && c0 >= c1))); cout << (ans ? "YES" : "NO") << endl; return 0; }