영어 원문입니다. 원문의 수식·표를 글자로 옮겨 모양이 다를 수 있습니다. 정확한 내용은 원문 페이지에서 확인하세요. 원문 페이지 열기 (새 창)
시간 제한 1초 · 메모리 제한 512 MB
Problem
You are given a string that consists of n characters between a–z. The positions of the string are indexed 1,2,…,n.
Your task is to process m operations of the following types:
- Change the character at position k to x
- Check if the substring from position a to position b is a palindrome
Input
The first input line has two integers n and m: the length of the string and the number of operations.
The next line has a string that consists of n characters.
Finally, there are m lines that describe the operations. Each line is of the form "1 k x" or "2 a b".
Output
For each operation 2, print YES if the substring is a palindrome and NO otherwise.
Constraints
- 1 ≤ n, m ≤ 2 · 10^5
- 1 ≤ k ≤ n
- 1 ≤ a ≤ b ≤ n
예제
예제 1
7 5 aybabtu 2 3 5 1 3 x 2 3 5 1 5 x 2 3 5
YES NO YES