#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
long long getint() {
  long long _x = 0, _tmp = 1;
  char _tc = getchar();
  while ((_tc < '0' || _tc > '9') && _tc != '-') _tc = getchar();
  if (_tc == '-') _tc = getchar(), _tmp = -1;
  while (_tc >= '0' && _tc <= '9') _x *= 10, _x += (_tc - '0'), _tc = getchar();
  return _x * _tmp;
}
long long mypow(long long _a, long long _x, long long _mod) {
  if (_x == 0) return 1ll;
  long long _tmp = mypow(_a, _x / 2, _mod);
  _tmp = (_tmp * _tmp) % _mod;
  if (_x & 1) _tmp = (_tmp * _a) % _mod;
  return _tmp;
}
bool equal(double _x, double _y) { return _x > _y - 1e-7 && _x < _y + 1e-7; }
int __ = 1, cs;
long long n, q, tn, dlt[500010 / 700 + 1];
vector<pair<long long, int> > v[500010 / 700 + 1];
void build() {}
void init() {
  n = getint();
  q = getint();
  for (int i = 0; i < n; i++) {
    long long tmp = getint();
    v[i / 700].push_back(make_pair(tmp, i));
  }
  tn = (n - 1) / 700;
  for (int i = 0; i <= tn; i++) sort(v[i].begin(), v[i].end());
}
void modify(long long l, long long r, long long x) {
  long long p1 = l / 700, p2 = r / 700;
  for (int i = p1 + 1; i < p2; i++) dlt[i] += x;
  for (int i = 0; i < (int)v[p1].size(); i++)
    if (v[p1][i].second >= l && v[p1][i].second <= r) v[p1][i].first += x;
  sort(v[p1].begin(), v[p1].end());
  if (p1 != p2) {
    for (int i = 0; i < (int)v[p2].size(); i++)
      if (v[p2][i].second >= l && v[p2][i].second <= r) v[p2][i].first += x;
    sort(v[p2].begin(), v[p2].end());
  }
}
int query(long long y) {
  int tmin = n + n, tmax = -n;
  for (int i = 0; i <= tn; i++) {
    int pos = lower_bound(v[i].begin(), v[i].end(), make_pair(y - dlt[i], -1)) -
              v[i].begin();
    if (pos < (int)v[i].size() && v[i][pos].first == y - dlt[i]) {
      tmin = min(tmin, v[i][pos].second);
      tmax = max(tmax, v[i][pos].second);
    }
    pos = upper_bound(v[i].begin(), v[i].end(),
                      make_pair(y - dlt[i], (int)n + (int)n)) -
          v[i].begin();
    if (pos - 1 < (int)v[i].size() && pos - 1 >= 0 &&
        v[i][pos - 1].first == y - dlt[i]) {
      tmin = min(tmin, v[i][pos - 1].second);
      tmax = max(tmax, v[i][pos - 1].second);
    }
  }
  if (tmax == -n) return -1;
  return tmax - tmin;
}
void solve() {
  while (q--) {
    int type = getint();
    if (type == 1) {
      long long l, r, x;
      l = getint();
      r = getint();
      x = getint();
      modify(l - 1, r - 1, x);
    } else {
      long long y = getint();
      printf("%d\n", query(y));
    }
  }
}
int main() {
  build();
  while (__--) {
    init();
    solve();
  }
}
