#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const int MAXN = 200005;
const long long mod = 1e7 + 9;
const int inf = 0x3f3f3f3f;
long long c[MAXN];
int a[MAXN];
template <class T>
inline void read(T &x) {
  int f = 0, ch = 0;
  x = 0;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = 1;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  if (f) x = -x;
}
int n;
int lowbit(int x) { return x & (-x); }
long long qsum(int x) {
  long long ans = 0;
  while (x > 0) {
    ans += c[x];
    x -= lowbit(x);
  }
  return ans;
}
void add(int x, long long s) {
  while (x <= n) {
    c[x] += s;
    x += lowbit(x);
  }
}
int main() {
  int i, j;
  int q;
  scanf("%d%d", &n, &q);
  for (i = 1; i <= n; i++) {
    read(a[i]);
    add(i, (long long)a[i]);
  }
  while (q--) {
    int s;
    read(i);
    read(s);
    add(i, s - a[i]);
    a[i] = s;
    int x = 1;
    if (c[1] == 0) {
      puts("1");
      continue;
    }
    int ans;
    int flag = false;
    while (x < n) {
      int l = x + 1, r = n;
      long long now = 2 * qsum(x);
      if (now == qsum(x + 1)) {
        flag = true;
        printf("%d\n", x + 1);
        break;
      }
      int k = x;
      while (l <= r) {
        int mid = l + r >> 1;
        if (qsum(mid) < now) {
          k = mid;
          l = mid + 1;
        } else {
          r = mid - 1;
        }
      }
      if (ans + 1 > n) {
        flag = true;
        puts("-1");
        break;
      }
      x = (k == x) ? k + 1 : k;
    }
    if (flag == 0) {
      printf("-1\n");
    }
  }
  return 0;
}
