#include <bits/stdc++.h>
using namespace std;
long long int a[500010];
vector<pair<long long int, int> > b[1010];
long long int c[1010], x, y;
int main() {
  ios_base::sync_with_stdio(0);
  int n, q, root, k, t, l, r;
  cin >> n >> q;
  for (int i = 0; i < n; i++) cin >> a[i];
  root = ceil((double)sqrt(n));
  k = 0;
  for (int i = 0; i < root; i++) {
    c[i] = 0;
    for (int j = 0; j < root; j++) {
      if (k < n) {
        b[i].push_back(make_pair(a[k], k));
        k++;
      }
    }
    sort(b[i].begin(), b[i].end());
  }
  while (q--) {
    cin >> t;
    if (t == 1) {
      cin >> l >> r >> x;
      l--;
      r--;
      for (int i = 0; i < root; i++) {
        if (i * root >= l && (i + 1) * root - 1 <= r)
          c[i] += x;
        else if ((i * root < l && (i + 1) * root - 1 >= l) ||
                 (i * root <= r && (i + 1) * root - 1 > r)) {
          int len = b[i].size();
          for (int j = 0; j < len; j++)
            if (b[i][j].second >= l && b[i][j].second <= r) b[i][j].first += x;
          sort(b[i].begin(), b[i].end());
        }
      }
    } else {
      cin >> y;
      int maxi = -1;
      int mini = n;
      for (int i = 0; i < root; i++) {
        if (!b[i].empty()) {
          int temp =
              lower_bound(b[i].begin(), b[i].end(), make_pair(y - c[i], -1)) -
              b[i].begin();
          if (b[i][temp].first == y - c[i]) mini = min(mini, b[i][temp].second);
          temp = upper_bound(b[i].begin(), b[i].end(),
                             make_pair(y - c[i], INT_MAX)) -
                 b[i].begin();
          if (temp && b[i][temp - 1].first == y - c[i])
            maxi = max(maxi, b[i][temp - 1].second);
        }
      }
      if (maxi >= mini)
        cout << maxi - mini << "\n";
      else
        cout << "-1\n";
    }
  }
  return 0;
}
