You are given a string S of length n consisting of only lowercase English letters.
There are q queries, each of the form (l,r), you have to determine if S[l…r] is a palindrome.
YES
if the string is a palindrome, otherwise print NO
.Input:
abcbd
2
1 3
2 4
Output:
NO
YES