char a[12];i;main(b){gets(a);for(;(b=~getchar())&&b+11&i-11;a[i]=0)for(i=-1;++i<11&&a[i]-~b;);i=!printf(i-11?"YES":"NO");}