b;void main(a,s){for(;gets(s);puts(a?"YES":"NO"))for(a=strtok(s," ");b=a?strtok(0," "):0;)a=strstr(b,a)?b:0;}