12033 - Find the pattern   

Description

Given a string S and a pattern P, please check if the pattern P is contained in the string S.

Examples:

  • S = abcdefg, P = abcde => the answer is YES
  • S = abcdefg, P = DEF => the answer is NO (DEF != def)
  • S = abcdefg, P = qaq => the answer is NO
  • S = abcdefg, P = ac => the answer is NO

Input

First line of input is the string S and its length Ls separated by a space.

Second line of input is the pattern P and its length Lp separated by a space.

It is guaranteed that 1 <= Lp <= 500, Lp <= Ls <= 100000.

Output

If the pattern P is contained in the string S, print out "YES" (without quotes); otherwise print "NO" (without quotes).

Note: remember to print a '\n' at the end of output.

Sample Input  Download

Sample Output  Download

Tags




Discuss