Palindromic Yarn Patches
Gats has a yarn whose colors are represented by a string of length . Each character represents the color of one consecutive position on the yarn.
A string of length is palindromic if
for every satisfying .
Gats considers independent queries. A query gives three integers , , and . For that query, Gats selects the substring
In one repaint operation, Gats may choose one position of the selected substring and change its character to any lowercase English letter. Determine whether the selected substring can be made palindromic using at most repaint operations.
All queries are independent, and repaint operations considered for one query do not change for any other query.
Input
The first line contains two integers and (, ), the length of the yarn and the number of queries.
Output
For each query, print YES if the selected substring can be made palindromic using at most repaint operations. Otherwise, print NO.
The answer may be printed using any combination of uppercase and lowercase letters.
Samples
Sample 1
Input
7 6 abacaba 1 7 0 1 6 2 1 6 3 2 5 2 2 6 0 3 4 0
Output
YES NO YES YES YES NO
The six selected substrings require minimum repaint counts of , , , , , and , respectively. Comparing these values with the corresponding repaint limits gives the displayed answers.