A dictionary supports two operations processed in order:
ADD w- add the wordw(lowercase English letters) to the dictionary.FIND p- the patternpmay contain lowercase letters and the wildcard character., which matches any single letter. Answer whether any added word matchespexactly: same length, and each non-.character equal, with each.matching any one letter.
Input format
Line 1: an integer q, the number of operations.
Each of the next q lines: ADD w or FIND p.
Output format
For each FIND operation, in order, print a line with YES or NO.
Constraints
- 1 <= q <= 20000
- Each word has length 1..12, lowercase letters.
- Each pattern has length 1..12, lowercase letters and
.only.