#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, w = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') w = -1;
    c = getchar();
  }
  while (c <= '9' && c >= '0') {
    x = (x << 1) + (x << 3) + c - '0';
    c = getchar();
  }
  return w == 1 ? x : -x;
}
int n, q, a[200005];
long long c[200005];
inline void add(int x, int v) {
  for (int i = x; i <= n; i += i & -i) c[i] += v;
}
inline long long sum(int x) {
  long long res = 0;
  for (int i = x; i; i -= i & -i) res += c[i];
  return res;
}
inline void solve() {
  int x = 1;
  if (sum(1) == 0) {
    puts("1");
    return;
  }
  while (x < n) {
    long long l = x + 1, r = n, k = x, now = 2 * sum(x);
    if (sum(x + 1) == now) {
      printf("%d\n", x + 1);
      return;
    }
    while (l <= r) {
      int mid = (l + r) >> 1;
      if (sum(mid) < now)
        k = mid, l = mid + 1;
      else
        r = mid - 1;
    }
    if (k + 1 > n) break;
    x = (k == x) ? k + 1 : k;
  }
  puts("-1");
}
int main() {
  n = read();
  q = read();
  for (int i = 1; i <= n; i++) a[i] = read(), add(i, a[i]);
  while (q--) {
    int x = read(), y = read();
    add(x, y - a[x]);
    a[x] = y;
    solve();
  }
  return 0;
}
