Pondo Compare
View as PDFProblem Statement
You are given a string of length
as well as
queries.
Each query will contain the following four integers as information: each of which is an integer between
and
. Pondo would like you to determine whether the substring
(both integers are inclusive).
Input Format
Your first line will contain two space-separated integers and
.
Your next line will contain a string of length
representing
.
Your next
lines will each contain
and
space-separated, representing the integers for that query.
Output Format
You should output one line for each query. For each line output YES if otherwise output
NO.
Constraints
## Sample Cases
Input 1
10 4
abcdfabcde
1 5 6 10
1 4 6 9
1 10 1 10
6 9 1 5
Output 1
NO
YES
YES
YES
Explanation 1
abcdf is not less than or equal to abcde
abcd is less than or equal to abcd
abcdfabcde is less than or equal to abcdfabcde
abcd is less than or equal to abcdf
Comments