#include <bits/stdc++.h>
using namespace std;
const int _ = 1e2;
const int maxn = 2e5 + _;
int n;
long long s[maxn];
int lowbit(int x) { return x & -x; }
void change(int x, long long k) {
  while (x <= n) s[x] += k, x += lowbit(x);
}
long long getsum(int x) {
  long long r = 0;
  while (x > 0) r += s[x], x -= lowbit(x);
  return r;
}
void solve() {
  long long S = getsum(1);
  int now = 1;
  if (S == 0) {
    puts("1");
    return;
  }
  while (now <= n) {
    int l = now + 1, r = n;
    now = n + 1;
    while (l <= r) {
      int mid = (l + r) / 2;
      if (2 * S <= getsum(mid)) {
        r = mid - 1;
        now = mid;
      } else
        l = mid + 1;
    }
    if (now <= n) {
      if (2 * getsum(now - 1) == getsum(now)) {
        printf("%d\n", now);
        return;
      }
    }
    S = getsum(now);
  }
  puts("-1");
}
long long a[maxn];
int main() {
  int Q;
  scanf("%d%d", &n, &Q);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), change(i, a[i]);
  int x, k;
  while (Q--) {
    scanf("%d%d", &x, &k);
    change(x, k - a[x]);
    a[x] = k;
    solve();
  }
  return 0;
}
