You are given N strings and Q questions. Each question contains two values X and Y. Print "Yes" if the Xth string is a subsequence of Yth string or Yth string is a subsequence of Xth string, otherwise,print "No".
A subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements. Read more about subsequences here.
Input format
Output format
Print the answer to each question in a new line.
Constraints
1≤|Si|≤106
1≤N≤105
N≤∑ni=1|Si|≤106
1≤Q≤105
1≤X,Y≤N
|Si| denotes length of ith string
Each string contains only lowercase alphabets.
1. acd is a subsequence of abcd.
2. acd is NOT a subsequence of bcf or vice versa.
3. ad is a subsequence of abcd.
4. ad is a subsequence of acd.