#include <bits/stdc++.h>
using namespace std;
const long long maxn = 4e5 + 10;
inline long long read() {
  long long x = 0, t = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') t = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * t;
}
long long n, q;
long long a[maxn], tr[maxn];
inline long long lowbit(long long x) { return x & (-x); }
inline void added(long long pos, long long x) {
  while (pos <= n) {
    tr[pos] += x;
    pos += lowbit(pos);
  }
  return;
}
inline long long getsum(long long pos) {
  long long res = 0;
  while (pos > 0) {
    res += tr[pos];
    pos -= lowbit(pos);
  }
  return res;
}
inline void solve() {
  long long x = 1;
  if (getsum(1) == 0) {
    printf("1\n");
    return;
  }
  while (x < n) {
    long long l = x + 1, r = n, mid;
    long long k = x, now = 2 * getsum(x);
    if (getsum(x + 1) == now) {
      printf("%lld\n", x + 1);
      return;
    }
    while (l <= r) {
      mid = (l + r) >> 1;
      if (getsum(mid) < now) {
        k = mid;
        l = mid + 1;
      } else
        r = mid - 1;
    }
    if (k + 1 > n) break;
    x = (k == x) ? k + 1 : k;
  }
  printf("-1\n");
  return;
}
int main() {
  n = read(), q = read();
  for (register long long i = 1; i <= n; ++i) {
    a[i] = read();
    added(i, a[i]);
  }
  long long po, x;
  while (q--) {
    po = read(), x = read();
    added(po, x - a[po]);
    a[po] = x;
    solve();
  }
  return 0;
}
