Fredo has got two strings s and t. Playing around with them, he came up with the following question:
Will string t be a subsequence of string s if he removes substring from string s ?
Given q queries, each query consists of indices i and j, you have to answer "Yes" if string t is a subsequence of remaining string s else answer "No".
Note:
Each query is independent of each other.
Input Format:
First line of input consists of string s.
Next line consists of string t.
Next line consists of two integers q 2 (q denoting number of queries and second integer always having value 2).
Each of following q lines consists of two integers i and j, denoting starting and ending indices of substring to be deleted from string s.
Output Format:
For each query , output "Yes" if t is a subsequence of remaining string s, else output "No".
Answer for each query should come in a new line.
Input Constraints:
Both strings s and t contain lowercase English alphabets.
Query 1: Remaining string s= "axy", clearly "ax" is a subsequence of this string.
Query 2: Remaining string s="abcaby", clearly "ax" is not a subsequence of this string.