시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB111150.000%

문제

Given a dictionary of obscene words S1S2, ..., Sn and text T, find if text contains one of obscene words as subsequence. If it does, find smallest prefix of T that contains such subsequence.

입력

First line of input contains one integer n - number of words in dictionary. Following n lines contain words from dictionary, one per line. Each word consists of ASCII characters with codes from 32 to 127, inclusive. Next line contains text T, consisting of the same set of characters. Total length of all words in dictionary doesn't exceed 100 KiB (100 x 210bytes). Total size of input file doesn't exceed 1 MiB (220bytes).

출력

Output NO if there is no obscene subsequence in the text. Otherwise output YES <X>, where X is the length of smallest prefix of T that contains some obscene subsequence.

예제 입력 1

2
hello
world
abracadabra

예제 출력 1

NO

예제 입력 2

2
hello
world
zzzheluuuulottt

예제 출력 2

YES 12