#include <bits/stdc++.h>
using namespace std;
int inf_int = 2e9;
long long inf_ll = 2e18;
const double pi = 3.1415926535898;
template <typename T, typename T1>
void prin(vector<pair<T, T1> >& a) {
  for (int i = 0; i < a.size(); i++) {
    cout << a[i].first << " " << a[i].second << "\n";
  }
}
template <typename T>
void prin(vector<T>& a) {
  for (int i = 0; i < a.size(); i++) {
    cout << a[i];
    if (i < a.size() - 1)
      cout << " ";
    else
      cout << "\n";
  }
}
template <typename T>
void prin(set<T>& a) {
  for (auto it = a.begin(); it != a.end(); it++) {
    cout << *it << " ";
  }
}
template <typename T>
void prin_new_line(vector<T>& a) {
  for (int i = 0; i < a.size(); i++) {
    cout << a[i] << "\n";
  }
}
template <typename T, typename T1>
void prin_new_line(vector<pair<T, T1> >& a) {
  for (int i = 0; i < a.size(); i++) {
    cout << a[i].first << " " << a[i].second << "\n";
  }
}
int sum_vec(vector<int>& a) {
  int s = 0;
  for (int i = 0; i < a.size(); i++) {
    s += a[i];
  }
  return s;
}
template <typename T>
T max(vector<T>& a) {
  T ans = a[0];
  for (int i = 1; i < a.size(); i++) {
    ans = max(ans, a[i]);
  }
  return ans;
}
template <typename T>
T min(vector<T>& a) {
  T ans = a[0];
  for (int i = 1; i < a.size(); i++) {
    ans = min(ans, a[i]);
  }
  return ans;
}
template <typename T>
T min(T a, T b, T c) {
  return min(a, min(b, c));
}
template <typename T>
T max(T a, T b, T c) {
  return max(a, max(b, c));
}
double s_triangle(double x1, double y1, double x2, double y2, double x3,
                  double y3) {
  return abs(((x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1)) / 2);
}
bool overflow(long long a, long long b) {
  if (a * b / b != a) return true;
  return false;
}
bool debug = 0;
const int maxn = 2e6 + 7;
int len;
vector<long long> add;
vector<pair<long long, int> > a[1000];
void solve() {
  int n;
  scanf("%d", &n);
  int q;
  scanf("%d", &q);
  len = sqrt(1.0 * n) + 1;
  add.resize(len);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    a[i / len].push_back({x, i});
  }
  for (int i = 0; i <= len; i++) {
    sort(a[i].begin(), a[i].end());
  }
  for (int j = 0; j < q; j++) {
    int x;
    scanf("%d", &x);
    if (x == 1) {
      int l, r, val;
      scanf("%d %d %d", &l, &r, &val);
      l--;
      r--;
      int cl_l = l / len, cl_r = r / len;
      if (cl_l == cl_r) {
        for (int i = 0; i < a[cl_l].size(); i++) {
          if (a[cl_l][i].second <= r && a[cl_l][i].second >= l) {
            a[cl_l][i].first += val;
          }
        }
        sort(a[cl_l].begin(), a[cl_l].end());
      } else {
        for (int i = 0; i < a[cl_l].size(); i++) {
          if (a[cl_l][i].second >= l) {
            a[cl_l][i].first += val;
          }
        }
        for (int i = cl_l + 1; i <= cl_r - 1; i++) {
          add[i] += val;
        }
        for (int i = 0; i < a[cl_r].size(); i++) {
          if (a[cl_r][i].second <= r) {
            a[cl_r][i].first += val;
          }
        }
        sort(a[cl_l].begin(), a[cl_l].end());
        sort(a[cl_r].begin(), a[cl_r].end());
      }
    } else {
      long long val;
      scanf("%I64d", &val);
      int f = -1, r = -1;
      for (int i = 0; i < len; i++) {
        long long val1 = val - add[i];
        if (f == -1) {
          int in = distance(a[i].begin(), lower_bound(a[i].begin(), a[i].end(),
                                                      make_pair(val1, -1)));
          if (in < a[i].size() && a[i][in].first == val1) {
            f = a[i][in].second;
          }
        }
        int in = distance(a[i].begin(), lower_bound(a[i].begin(), a[i].end(),
                                                    make_pair(val1 + 1, -1)));
        if (in && a[i][in - 1].first == val1) {
          r = a[i][in - 1].second;
        }
      }
      if (f == -1) {
        printf("-1\n");
      } else {
        printf("%d\n", r - f);
      }
    }
  }
}
int main() {
  if (!debug) {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
  }
  int t = 1;
  while (t--) solve();
  return 0;
}
