#include using namespace std; int main(void){ int a[3],b[3],i=0; bool c=false; scanf("%d.%d.%d%d.%d.%d",a,a+1,a+2,b,b+1,b+2); if(a[i]>b[i]){ c=true; }else if(a[i]==b[i]){ i++; if(a[i]>b[i]) c=true; else if(a[i]==b[i]&&a[i+1]>=b[i+1]) c=true; } if(c) cout<<"YES\n"; else cout<<"NO\n"; return 0; }