#include #include #include #include #include #include #include #include #include #include #include #include #include #include #define INF 1000000000 using namespace std; typedef long long ll; int main(void) { int s1[3], s2[3]; scanf("%d.%d.%d", s1, s1+1, s1+2); scanf("%d.%d.%d", s2, s2+1, s2+2); for (int i = 0; i < 3; i++) { if (s1[i] > s2[i]) { cout << "YES" << endl; return 0; } else if (s1[i] < s2[i]) { break; } else if (i == 2) { cout << "YES" << endl; return 0; } } cout << "NO" << endl; return 0; }