#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
bool local = false;
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << "[" << H << "]";
  debug_out(T...);
}
clock_t startTime;
double getCurrentTime() {
  return (double)(clock() - startTime) / CLOCKS_PER_SEC;
}
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
const double eps = 0.00001;
const int MOD = 1e9 + 7;
const int INF = (1 << 30) - (1 << 25);
const long long LLINF = 1223372000000000555;
const int N = 1e6 + 3e4;
const int M = 1234;
const int LOG = 19;
long long a[N], add[M];
int k;
vector<pair<long long, int>> block[M];
int block_min[M], block_max[M];
void out() {
  for (int i = 0; i <= k; i++) {
    if (block[i].empty()) continue;
    cout << i << endl;
    for (auto now : block[i]) {
      cout << now.second << ' ' << now.first + add[i] << endl;
    }
  }
  cout << endl;
}
void solve(int TC) {
  42;
  int n, q;
  cin >> n >> q;
  k = sqrt(n) + 5;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    block[i / k].emplace_back(a[i], i);
  }
  for (int i = 0; i <= k; i++) {
    if (block[i].empty()) continue;
    block_min[i] = block[i][0].second;
    block_max[i] = block[i].back().second;
    sort(block[i].begin(), block[i].end());
  }
  while (q--) {
    int t;
    cin >> t;
    if (t == 1) {
      int l, r, x;
      cin >> l >> r >> x;
      for (int i = 0; i <= k; i++) {
        if (block[i].empty()) continue;
        if (l <= block_min[i] && block_max[i] <= r) {
          add[i] += x;
          continue;
        }
        if (!(l > block_max[i] || block_min[i] > r)) {
          for (auto &now : block[i]) {
            int ind = now.second;
            if (ind >= l && ind <= r) {
              a[ind] += x;
              now.first += x;
            }
          }
          sort(block[i].begin(), block[i].end());
        }
      }
    } else {
      long long y;
      cin >> y;
      int mn = INF, mx = -INF;
      for (int i = 0; i <= k; i++) {
        if (mn != INF) break;
        if (block[i].empty()) continue;
        long long x = y - add[i];
        int l = 1, r = block[i].size();
        while (l <= r) {
          int m = (l + r) >> 1;
          if (block[i][m - 1].first >= x) {
            mn = block[i][m - 1].second;
            r = m - 1;
          } else
            l = m + 1;
        }
        if (mn != INF && a[mn] != x) mn = INF;
      }
      for (int i = k; i >= 0; i--) {
        if (mx != -INF) break;
        if (block[i].empty()) continue;
        long long x = y - add[i];
        int l = 1, r = block[i].size();
        while (l <= r) {
          int m = (l + r) >> 1;
          if (block[i][m - 1].first <= x) {
            mx = block[i][m - 1].second;
            l = m + 1;
          } else
            r = m - 1;
        }
        if (mx != -INF && a[mx] != x) mx = -INF;
      }
      42;
      cout << (mn == INF || mx == -INF ? -1 : mx - mn) << endl;
    }
  }
}
int main() {
  startTime = clock();
  ios_base::sync_with_stdio(false);
  int TC = 1;
  for (int test = 1; test <= TC; test++) {
    42;
    solve(test);
  }
  if (local)
    cerr << endl << "Time: " << getCurrentTime() * 1000 << " ms" << endl;
  return 0;
}
