#include using namespace std; signed main(){ int a,b,c;char k;cin>>a>>k>>b>>k>>c; int A=a*100+b*10+c; cin>>a>>k>>b>>k>>c; cout<<(a*100+b*10+c>A?"NO":"YES")<