#include #include #include #define ALL(x) (x).begin(),(x).end() using namespace std; int main() { int a1,b1,c1,a2,b2,c2; scanf("%d.%d.%d",&a1,&b1,&c1); scanf("%d.%d.%d",&a2,&b2,&c2); string ans = "NO"; if(a1 > a2)ans = "YES"; if(a1 == a2 && b1 > b2)ans = "YES"; if(a1 == a2 && b1 == b2 && c1 >= c2)ans = "YES"; cout << ans << endl; return 0; }