#include #include #include #include #include #include #include #include #include #include #include #include typedef long long ll; using namespace std; #define mod 1000000007 #define INF 1000000000 //(int)1e9 #define LLINF 2000000000000000000 //(ll)2e18 #define PI 3.1415926536 #define SIZE 1000 int main(){ int a,b,c; pair,int> p1,p2; scanf("%d.%d.%d",&a,&b,&c); p1 = {{a,b},c}; scanf("%d.%d.%d",&a,&b,&c); p2 = {{a,b},c}; if(p1>=p2){ puts("YES"); }else{ puts("NO"); } return 0; }