#include <bits/stdc++.h>
using namespace std;


struct SegmentTree {
  int n;
  vector<int> tree;
  SegmentTree(int size) {
    n = size;
    tree.assign(4 * n + 4, 0);
  }
  void build(vector<int> &last, int node, int l, int r) {
    if (l == r) {
      tree[node] = last[l];
    } else {
      int mid = (l + r) / 2;
      build(last, 2 * node, l, mid);
      build(last, 2 * node + 1, mid + 1, r);
      tree[node] = max(tree[2 * node], tree[2 * node + 1]);
    }
  }
  void upd(int node, int l, int r, int pos, int val) {
    if (l == r) {
      tree[node] = val;
    } else {
      int mid = (l + r) / 2;
      if (pos <= mid)
        upd(2 * node, l, mid, pos, val);
      else
        upd(2 * node + 1, mid + 1, r, pos, val);
      tree[node] = max(tree[2 * node], tree[2 * node + 1]);
    }
  }
  int getmax(int node, int l, int r, int L, int R) {
    if (r < L || l > R)
      return -1;
    if (L <= l && r <= R)
      return tree[node];
    int mid = (l + r) / 2;
    return max(getmax(2 * node, l, mid, L, R),
               getmax(2 * node + 1, mid + 1, r, L, R));
  }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, q;
  cin >> n >> q;
  vector<int> a(n + 1);
  for (int i = 1; i <= n; i++)
    cin >> a[i];
  const int MAX_COLOR = 1000001;
  vector<set<int> *> cp(MAX_COLOR, nullptr);
  for (int i = 1; i <= n; i++) {
    int c = a[i];
    if (cp[c] == nullptr) {
      cp[c] = new set<int>();
    }
    cp[c]->insert(i);
  }
  vector<int> last(n + 1, 0);
  for (int c = 0; c < MAX_COLOR; c++) {
    if (cp[c] == nullptr)
      continue;
    int prev = 0;
    for (auto it = cp[c]->begin(); it != cp[c]->end();
         ++it) {
      int pos = *it;
      last[pos] = prev;
      prev = pos;
    }
  }
  SegmentTree st(n);
  st.build(last, 1, 1, n);
  while (q--) {
    int type;
    cin >> type;
    if (type == 1) {
      int id, x;
      cin >> id >> x;
      int c_old = a[id];
      if (c_old == x) {
        continue;
      }
      if (cp[c_old] != nullptr) {
        auto it_old = cp[c_old]->find(id);
        if (it_old != cp[c_old]->end()) {
          int p_prev = 0;
          if (it_old != cp[c_old]->begin()) {
            auto it_prev = it_old;
            --it_prev;
            p_prev = *it_prev;
          }
          auto it_next = it_old;
          ++it_next;
          if (it_next != cp[c_old]->end()) {
            int p_next = *it_next;
            last[p_next] = p_prev;
            st.upd(1, 1, n, p_next, last[p_next]);
          }
          cp[c_old]->erase(it_old);
        }
      }
      if (cp[x] == nullptr) {
        cp[x] = new set<int>();
      }
      auto &s_new = *cp[x];
      auto it_new = s_new.lower_bound(id);
      int ppn = 0;
      if (it_new != s_new.begin()) {
        auto it_prev_new = it_new;
        --it_prev_new;
        ppn = *it_prev_new;
      }
      int pnn = 0;
      if (it_new != s_new.end()) {
        pnn = *it_new;
      }
      s_new.insert(id);
      last[id] = ppn;
      st.upd(1, 1, n, id, last[id]);
      if (pnn != 0) {
        last[pnn] = id;
        st.upd(1, 1, n, pnn, last[pnn]);
      }
      a[id] = x;
    } else if (type == 2) {
      int l, r;
      cin >> l >> r;
      int max_last = st.getmax(1, 1, n, l, r);
      if (max_last >= l) {
        cout << "yes\n";
      } else {
        cout << "no\n";
      }
    }
  }
  for (int c = 0; c < MAX_COLOR; c++)
    if (cp[c] != nullptr)
      delete cp[c];
}