시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 114 42 37 44.048%

문제

옛날 옛적, 일곱 언덕과 일곱 바다를 건너 작은 마을이 있었어요. 백설공주는 놀고 먹고 자다가 일어나서 문명 5, 리그 오브 레전드, 풋볼 매니저를 하다가 다시 자는 난쟁이들 N명과 살고 있었어요. 계속되는 이런 생활에 진저리가 난 백설공주는 난쟁이들에게 고통을 주기로 결심했고, 체육 수업을 빙자한 얼차려를 주기로 했답니다!

수업이 시작할 때, 난쟁이들은 키가 큰 순서로 한 줄로 서 있어야 돼요. 신기하게도 난쟁이들 중 키가 같은 사람은 한 명도 없었고, 정확하게 1, 2, ... , Ncm의 키를 가지고 있었어요. 하지만, 난쟁이들의 머리는 계속되는 트롤링으로 인해 피폐해져 있었고, 자기들끼리 키를 비교해 한 줄로 설만큼의 지능조차 없었답니다. 그래서 백설공주는 다음 명령을 통해 난쟁이들을 조종하기로 했어요.

  • 1 X Y -- X번째 위치와 Y번째 위치에 있는 난쟁이 둘이 위치를 바꾸도록 합니다.또 백설공주는 다음 명령으로 난쟁이들이 줄 서있는 순서를 살펴봅니다.

또 백설공주는 다음 명령으로 난쟁이들이 제대로 서 있는지를 확인해요.

  • 2 A B -- A, A+1, ..., Bcm의 키를 가진 난쟁이들이 모두 이웃해 서 있는지 확인합니다(꼭 A, A+1, ..., B 순서일 필요는 없습니다).

멍청한 난쟁이들이 백설공주가 시키는대로 잘 따르게 도와줘 더 이상 백설공주가 화나지 않게 해주세요!

입력

입력의 첫 번째 줄에 난쟁이들의 인원수 N과 백설공주가 명령하는 횟수 M이 주어집니다.(2 ≤ N ≤ 200 000, 2 ≤ M ≤ 200 000).

다음 줄에는 난쟁이들이 처음에 서 있는 순서를 나타내는 N개의 자연수가 주어집니다(자연수의 범위는 1부터 N까지이며, 한 숫자는 한번만 주어집니다).

다음 M개의 줄에는 백설공주의 명령이 주어지는데, 

"1 X Y" (1 ≤ X, Y ≤N, X ≠ Y) 또는

“2 A B” (1 ≤ A ≤ B ≤ N) 꼴로 주어지고 그 의미는 위에서 설명한 바와 같습니다.

출력

출력엔 2번째 형태의 백설공주의 명령에 대한 대답을 "YES"나 "NO"로 한 줄에 한번씩 출력합니다.

예제 입력 1

5 3
2 4 1 3 5
2 2 5
1 3 1
2 2 5

예제 출력 1

NO
YES
W3sicHJvYmxlbV9pZCI6IjU4MTciLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWFjZTBcdWQxYjVcdWJjMWJcdWIyOTQgXHViMDljXHVjN2MxXHVjNzc0XHViNGU0IiwiZGVzY3JpcHRpb24iOiI8cD5cdWM2MWJcdWIwYTAgXHVjNjFiXHVjODAxLCBcdWM3N2NcdWFjZjEgXHVjNWI4XHViMzU1XHVhY2ZjIFx1Yzc3Y1x1YWNmMSBcdWJjMTRcdWIyZTRcdWI5N2MgXHVhYzc0XHViMTA4IFx1Yzc5MVx1Yzc0MCBcdWI5YzhcdWM3NDRcdWM3NzQgXHVjNzg4XHVjNWM4XHVjNWI0XHVjNjk0LiBcdWJjMzFcdWMxMjRcdWFjZjVcdWM4ZmNcdWIyOTQgXHViMTgwXHVhY2UwIFx1YmEzOVx1YWNlMCBcdWM3OTBcdWIyZTRcdWFjMDAgXHVjNzdjXHVjNWI0XHViMDk4XHVjMTFjIFx1YmIzOFx1YmE4NSA1LCBcdWI5YWNcdWFkZjggXHVjNjI0XHViZTBjIFx1YjgwOFx1YzgwNFx1YjRkYywgXHVkNDhiXHViY2ZjIFx1YjllNFx1YjJjOFx1YzgwMFx1Yjk3YyBcdWQ1NThcdWIyZTRcdWFjMDAgXHViMmU0XHVjMmRjIFx1Yzc5MFx1YjI5NCBcdWIwOWNcdWM3YzFcdWM3NzRcdWI0ZTQgTlx1YmE4NVx1YWNmYyBcdWMwYjRcdWFjZTAgXHVjNzg4XHVjNWM4XHVjNWI0XHVjNjk0LiBcdWFjYzRcdWMxOGRcdWI0MThcdWIyOTQgXHVjNzc0XHViN2YwIFx1YzBkZF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