#include <iostream>
#include <vector>
using namespace std;
void updateIsSorted(vector<bool>& isSorted, const vector<int>& arr, int start, int end) {
for (int i = start; i <= end; ++i) {
if (i > 0) {
isSorted[i] = arr[i - 1] <= arr[i];
}
}
}
int main() {
int N, Q;
cin >> N >> Q;
vector<int> arr(N);
vector<bool> isSorted(N - 1, true);
for (int i = 0; i < N; ++i) {
cin >> arr[i];
}
for (int i = 0; i < N - 1; ++i) {
isSorted[i] = arr[i] <= arr[i + 1];
}
for (int i = 0; i < Q; ++i) {
int type;
cin >> type;
if (type == 1) {
int idx, x;
cin >> idx >> x;
--idx;
arr[idx] = x;
if (idx > 0) {
isSorted[idx - 1] = arr[idx - 1] <= arr[idx];
}
if (idx < N - 1) {
isSorted[idx] = arr[idx] <= arr[idx + 1];
}
} else if (type == 2) {
int l, r;
cin >> l >> r;
--l; --r;
bool sorted = true;
for (int j = l; j < r; ++j) {
if (!isSorted[j]) {
sorted = false;
break;
}
}
cout << (sorted ? "YES" : "NO") << endl;
}
}
return 0;
}