A signboard printer owns a set of reusable word tiles. It wants to know whether a requested phrase (given with no separators) can be built by concatenating tiles from its dictionary, where each tile may be used any number of times and the whole phrase must be covered exactly.
Input format
Line 1: an integer k, the number of dictionary words.
Line 2: k space-separated distinct dictionary words.
Line 3: the target string s.
Output format
Print YES if s can be segmented into a sequence of dictionary words, otherwise NO.
Constraints
- 1 <= k <= 20
- 1 <= length of each dictionary word <= 20
- 1 <= length of
s<= 300 - All strings consist of lowercase English letters only.