#Lutece2478. Little Horse's Problem
Little Horse's Problem
Migrated from Lutece 2478 Little Horse's Problem
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Little Horse loves making problems. This day, Little Horse meets Little Rabbit. He immediately makes a problem for Little Rabbit.
Given a string of length . There are two kinds of operations.
- : query whether the substring and are the same.
- : right circular shift the substring by positions.
If you right circular shift by position, you will get . To right circular shift by positions means to repeat such operation times.
Now, Little Horse has operations. He wants Little Rabbit to tell him the result. Little Rabbit is not clever enough to answer this problem. Can you help him?
Input
The first line contains two integers and () — the length of and the number of operations.
The second line contains a string , which consists of only lowercase letters.
In the next lines, each line contains an operation. The format is in the description ($1 \le l_1 \le r_1 \le n, 1 \le l_2 \le r_2 \le n, 1 \le l \le r \le n,1 \le k \le 2\times10^5$).
Output
For each operation , output Yes
or No
in a line.
Samples
6 4
aabbab
2 1 6 1
1 1 2 5 6
2 1 6 2
1 1 2 5 6
Yes
No
Constraints
$1 \le l_1 \le r_1 \le n, 1 \le l_2 \le r_2 \le n, 1 \le l \le r \le n,1 \le k \le 2\times10^5$
Note
aabbab
- : right circular shift the substring by positions.
baabba
- : query whether the substring and are the same.
Yes
- : right circular shift the substring by positions.
babaab
- : query whether the substring and are the same.
No
Resources
Macaron_lin