#include <bits/stdc++.h>
#pragma GCC optimize(3)
using namespace std;
long long A[1 << 20], B[1 << 20], n, T, x, y, l, r, m, t, p;
void U(long long i, long long x) {
  while (i <= n) {
    B[i] += x;
    i += i & -i;
  }
}
long long Q(long long i) {
  long long r = 0;
  while (i) {
    r += B[i];
    i -= i & -i;
  }
  return r;
}
int main() {
  scanf("%lld %lld", &n, &T);
  for (l = 1; l <= n; ++l) {
    scanf("%lld", &A[l]);
    U(l, A[l]);
  }
  while (T--) {
    scanf("%lld %lld", &x, &y);
    U(x, y - A[x]);
    A[x] = y;
    l = 1, r = n, t = 0, x = -1;
    while (l <= r) {
      p = Q(m = l + r >> 1);
      if (p < t) {
        l = m + 1;
        t = p * 2;
      } else
        r = m;
      if (l == r) {
        if (Q(l - 1) == A[l]) {
          x = l;
          break;
        }
        if (l >= n) break;
        t = 2 * Q(l++), r = n;
      }
    }
    printf("%lld\n", x);
  }
}
