#coding:utf-8 a=raw_input() b=raw_input() s='' for i in a: if i in b: s+=i if len(s)==len(b): print 'YES' else: print 'NO'