#Lutece1856. Find Substring

Find Substring

Migrated from Lutece 1856 Find Substring

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

Given a string S consisting of lower-case English letters only, your task is to find out if there is a substring which the number of 'aa','bb'.. are cnta,cntb,...cnt_a,cnt_b,...?

Input

The first line of the input contains a string SS(1S1051\leq |S| \leq 10^5)

The next line contains 2626 integers cnta,cntb...cnt_a,cnt_b... (0cntiS0\leq cnt_i\leq|S|).

Output

If there is a substring meets the above conditions, print the word Yes

Otherwise print the word No on a single line.

Samples

abcde
0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Yes
abcde
0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
No

Resources

The 16th UESTC Programming Contest Preliminary