#include <bits/stdc++.h>
using namespace std;
const int N = 200000;
int n, cq;
long long a[N + 9], sum[N + 9];
void into() {
  scanf("%d%d", &n, &cq);
  for (int i = 1; i <= n; ++i) {
    scanf("%lld", &a[i]);
    sum[i] = sum[i - 1] + a[i];
  }
}
long long c[N + 9];
void Add(int p, long long v) {
  for (; p <= n; p += p & -p) c[p] += v;
}
long long Query(int p) {
  long long res = 0;
  for (; p; p -= p & -p) res += c[p];
  return res;
}
void work() {
  for (int i = 1; i <= n; ++i) Add(i, a[i]);
}
int Query() {
  for (int p = 1; p <= n;) {
    long long v = Query(p);
    if (Query(p - 1) << 1 == v) return p;
    int l = p + 1, r = n, t = n + 1;
    for (int mid; l <= r; Query(mid = l + r >> 1) >= v << 1
                              ? (t = mid, r = mid - 1)
                              : l = mid + 1)
      ;
    p = t;
  }
  return -1;
}
void getans() {
  for (; cq--;) {
    int x;
    long long y;
    scanf("%d%lld", &x, &y);
    Add(x, -a[x]);
    Add(x, a[x] = y);
    printf("%d\n", Query());
  }
}
int main() {
  int T = 1;
  for (; T--;) {
    into();
    work();
    getans();
  }
  return 0;
}
