#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5, M = 5e2 + 5, seg = 1000;
long long val[M];
pair<long long, int> v[N];
int main() {
  int n, i, j, q, type, l, r, first, f, last, a, b, ind, u;
  long long z;
  cin >> n >> q;
  for (i = 1; i <= n; ++i) cin >> v[i].first, v[i].second = i;
  for (i = 1; i <= n; i += seg) sort(v + i, v + min(n, i + seg - 1) + 1);
  while (q--) {
    cin >> type;
    if (type == 1) {
      cin >> l >> r >> first;
      for (i = 1, f = 0; i <= n; ++f, i += seg) {
        a = i, b = min(n, i + seg - 1);
        if (r < a || b < l) continue;
        if (l <= a && b <= r) {
          val[f] += first;
          continue;
        }
        for (j = i; j <= b; ++j)
          if (l <= v[j].second && v[j].second <= r) v[j].first += first;
        sort(v + a, v + b + 1);
      }
    } else {
      cin >> first;
      a = n, b = 0;
      for (i = 1, f = 0; i <= n; i += seg, ++f) {
        z = first - val[f];
        l = lower_bound(v + i, v + min(n, i + seg - 1) + 1, make_pair(z, 0)) -
            v;
        r = lower_bound(v + i, v + min(n, i + seg - 1) + 1,
                        make_pair(z + 1, 0)) -
            v - 1;
        if (l <= r) a = min(a, v[l].second), b = max(b, v[r].second);
      }
      if (a > b) {
        cout << -1 << endl;
      } else
        cout << b - a << endl;
    }
  }
}
