#include <bits/stdc++.h>
using namespace std;
long long n, q;
long long a[300010];
class tree {
 public:
  long long dat[300010];
  inline void add(long long p, long long x) {
    for (long long i = p; i <= n; i += i & (-i)) dat[i] += x;
  }
  inline long long query(long long p) {
    long long ans = 0;
    for (long long i = p; i; i -= i & (-i)) ans += dat[i];
    return ans;
  }
} T;
inline void solve() {
  long long x = 1;
  if (T.query(1) == 0) {
    puts("1");
    return;
  }
  while (x < n) {
    long long l = x + 1, r = n, k = x, cur = 2 * T.query(x);
    if (T.query(x + 1) == cur) {
      printf("%d\n", x + 1);
      return;
    }
    while (l <= r) {
      long long mid = (l + r) >> 1;
      if (T.query(mid) < cur)
        k = mid, l = mid + 1;
      else
        r = mid - 1;
    }
    if (k + 1 > n) break;
    x = ((k == x) ? k + 1 : k);
  }
  puts("-1");
}
long long x, y;
int main() {
  scanf("%lld%lld", &n, &q);
  for (long long i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    T.add(i, a[i]);
  }
  for (long long i = 1; i <= q; i++) {
    scanf("%d%d", &x, &y);
    T.add(x, y - a[x]);
    a[x] = y;
    solve();
  }
  return 0;
}
