#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma G++ optimize("O3")
using namespace std;
const int Maxn = 200005;
long long n, q, v[Maxn], a[Maxn];
inline void upd(long long x, long long y) {
  for (; x <= n; x += x & -x) a[x] += y;
}
inline long long sum(long long x) {
  long long ret = 0;
  for (; x; x -= x & -x) ret += a[x];
  return ret;
}
int main() {
  scanf("%lld%lld", &n, &q);
  for (register long long i = 1; i <= n; ++i) {
    scanf("%lld", &v[i]);
    upd(i, v[i]);
  }
  for (register long long i = 0, x, d; i < q; ++i) {
    scanf("%lld%lld", &x, &d);
    upd(x, d - v[x]);
    v[x] = d;
    long long S = 0, pos = 1, ans = -1;
    while (pos <= n) {
      long long l = pos, r = n;
      while (l < r) {
        long long m = l + r >> 1;
        if (sum(m) < S)
          l = m + 1;
        else
          r = m;
      }
      if (sum(l) == 2 * v[l]) {
        ans = l;
        break;
      }
      S = max(S + 1, 2 * sum(l));
      pos = l + 1;
    }
    printf("%lld\n", ans);
  }
  return 0;
}
