#include <bits/stdc++.h>
using namespace std;
int BLOCK;
vector<pair<long long, int> > G[880];
long long add[880];
int n, q;
int search1(long long x, vector<pair<long long, int> > &tmp) {
  int l = 0, r = tmp.size() - 1;
  if (tmp[l].first > x || tmp[r].first < x) {
    return -1;
  }
  while (l < r) {
    int mid = (l + r) >> 1;
    if (x <= tmp[mid].first) {
      r = mid;
    } else {
      l = mid + 1;
    }
  }
  if (tmp[l].first == x) {
    return tmp[l].second;
  }
  return -1;
}
int search2(long long x, vector<pair<long long, int> > &tmp) {
  int l = 0, r = tmp.size() - 1;
  if (tmp[l].first > x || tmp[r].first < x) {
    return -1;
  }
  while (l < r) {
    int mid = (l + r + 1) >> 1;
    if (x >= tmp[mid].first) {
      l = mid;
    } else {
      r = mid - 1;
    }
  }
  if (tmp[r].first == x) {
    return tmp[r].second;
  }
  return -1;
}
int main() {
  while (~scanf("%d%d", &n, &q)) {
    for (int i = 0; i < BLOCK; i++) {
      G[i].clear();
    }
    BLOCK = (int)sqrt(n) + 1;
    memset(add, 0, sizeof(add));
    for (int i = 0; i < n; i++) {
      long long val;
      scanf("%I64d", &val);
      G[i / BLOCK].push_back(make_pair(val, i));
    }
    for (int i = 0; i <= (n - 1) / BLOCK; i++) {
      sort(G[i].begin(), G[i].end());
    }
    for (int i = 0; i < q; i++) {
      int op, l, r, x;
      scanf("%d", &op);
      if (op == 1) {
        scanf("%d%d%d", &l, &r, &x);
        l--, r--;
        int id1 = l / BLOCK;
        int id2 = r / BLOCK;
        for (int j = id1 + 1; j <= id2 - 1; j++) {
          add[j] += x;
        }
        for (int j = 0; j < G[id1].size(); j++) {
          if (G[id1][j].second <= r && G[id1][j].second >= l) {
            G[id1][j].first += x;
          }
        }
        sort(G[id1].begin(), G[id1].end());
        for (int j = 0; id1 != id2 && j < G[id2].size(); j++) {
          if (G[id2][j].second <= r && G[id2][j].second >= l) {
            G[id2][j].first += x;
          }
        }
        sort(G[id2].begin(), G[id2].end());
      } else {
        scanf("%d", &x);
        int ans1, ans2;
        for (int j = 0; j <= (n - 1) / BLOCK; j++) {
          ans1 = search1(x - add[j], G[j]);
          if (~ans1) {
            break;
          }
        }
        for (int j = (n - 1) / BLOCK; j >= 0; j--) {
          ans2 = search2(x - add[j], G[j]);
          if (~ans2) {
            break;
          }
        }
        if (ans1 == -1 || ans2 == -1) {
          printf("-1\n");
        } else {
          printf("%d\n", ans2 - ans1);
        }
      }
    }
  }
  return 0;
}
