#include <bits/stdc++.h>
using namespace std;
int n, q;
int a[200005];
long long bit[200005];
inline void update(int p, int val) {
  while (p <= n) {
    bit[p] += val;
    p += p & -p;
  }
}
inline long long query(int p) {
  long long ret = 0;
  while (p) {
    ret += bit[p];
    p -= p & -p;
  }
  return ret;
}
int mx[800004];
inline void build(int v = 1, int l = 2, int r = n) {
  if (l == r)
    mx[v] = a[l];
  else {
    int m = l + r >> 1;
    build(v << 1, l, m);
    build(v << 1 | 1, m + 1, r);
    mx[v] = max(mx[v << 1], mx[v << 1 | 1]);
  }
}
inline void Update(int p, int val, int v = 1, int l = 2, int r = n) {
  if (l == r)
    mx[v] = val;
  else {
    int m = l + r >> 1;
    if (p <= m)
      Update(p, val, v << 1, l, m);
    else
      Update(p, val, v << 1 | 1, m + 1, r);
    mx[v] = max(mx[v << 1], mx[v << 1 | 1]);
  }
}
inline int Query(int x, int v = 1, int l = 2, int r = n) {
  if (l == r)
    return l;
  else {
    int m = l + r >> 1;
    if (mx[v << 1] >= x)
      return Query(x, v << 1, l, m);
    else
      return Query(x, v << 1 | 1, m + 1, r);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> q;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    update(i, a[i]);
  }
  if (n == 1) {
    while (q--) {
      int p, x;
      cin >> p >> x;
      cout << (x == 0 ? 1 : -1) << endl;
    }
    return 0;
  }
  build();
  while (q--) {
    int p, x;
    cin >> p >> x;
    update(p, x - a[p]);
    if (p > 1) Update(p, x);
    a[p] = x;
    int ptr = 1;
    x = a[1];
    if (a[1] == 0) {
      cout << 1 << endl;
      continue;
    }
    bool ok = 0;
    while (mx[1] >= x) {
      ptr = Query(x);
      long long tmp = query(ptr - 1);
      tmp = min(tmp, (long long)1e9 + 7);
      if ((int)tmp == a[ptr]) {
        cout << ptr << endl;
        ok = 1;
        break;
      }
      x = tmp + a[ptr];
    }
    if (!ok) cout << -1 << endl;
  }
  return 0;
}
