#include <bits/stdc++.h>
using namespace std;
const int MN = 500111;
int n, q;
int a[MN];
const int BUCKET = 700;
struct Bucket {
  int from, to;
  vector<pair<long long, int> > x;
  long long val;
} buckets[MN / BUCKET + 11];
int main() {
  while (scanf("%d%d", &n, &q) == 2) {
    for (int i = (1), _b = (n); i <= _b; i++) scanf("%d", &a[i]);
    int nBucket = 0;
    for (int id = 1, start = 1, last = BUCKET; start <= n;
         start += BUCKET, last += BUCKET, ++id) {
      buckets[id].from = start;
      buckets[id].to = min(last, n);
      buckets[id].x.clear();
      buckets[id].val = 0;
      for (int i = (buckets[id].from), _b = (buckets[id].to); i <= _b; i++) {
        buckets[id].x.push_back(make_pair(a[i], i));
      }
      sort(buckets[id].x.begin(), buckets[id].x.end());
      nBucket = id;
    }
    while (q--) {
      int typ;
      scanf("%d", &typ);
      if (typ == 1) {
        int l, r, val;
        scanf("%d%d%d", &l, &r, &val);
        for (int id = (1), _b = (nBucket); id <= _b; id++) {
          if (l <= buckets[id].from && buckets[id].to <= r)
            buckets[id].val += val;
          else if (r < buckets[id].from || buckets[id].to < l) {
          } else {
            for (int i = 0, _a = (buckets[id].x.size()); i < _a; i++)
              if (l <= buckets[id].x[i].second && buckets[id].x[i].second <= r)
                buckets[id].x[i].first += val;
            sort(buckets[id].x.begin(), buckets[id].x.end());
            while (!buckets[id].x.empty() &&
                   buckets[id].x.back().first > 1000000000)
              buckets[id].x.pop_back();
          }
        }
      } else {
        int first = -1;
        int last = -1;
        int y;
        scanf("%d", &y);
        for (int id = (1), _b = (nBucket); id <= _b; id++) {
          long long need = y - buckets[id].val;
          if (need < 0) continue;
          auto t = lower_bound(buckets[id].x.begin(), buckets[id].x.end(),
                               make_pair(need, 0));
          if (t == buckets[id].x.end() || t->first != need) continue;
          first = t->second;
          break;
        }
        for (int id = (nBucket), _b = (1); id >= _b; id--) {
          long long need = y - buckets[id].val;
          if (need < 0) continue;
          auto t = lower_bound(buckets[id].x.begin(), buckets[id].x.end(),
                               make_pair(need + 1, 0));
          if (t == buckets[id].x.begin()) continue;
          --t;
          if (t->first != need) continue;
          last = t->second;
          break;
        }
        if (first < 0)
          printf("-1\n");
        else
          printf("%d\n", last - first);
      }
    }
  }
  return 0;
}
