#include <bits/stdc++.h>
using namespace std;
const int N = 200200;
int n, q;
long long a[N], seg[N << 2], lzy[N << 2];
void push(int i, int L, int R) {
  if (!lzy[i]) return;
  seg[i] += lzy[i];
  if (L != R) {
    lzy[i << 1] += lzy[i];
    lzy[i << 1 | 1] += lzy[i];
  }
  lzy[i] = 0;
}
void upd(int i, int L, int R, int from, int to, long long val) {
  push(i, L, R);
  if (L > to || R < from) return;
  if (from <= L && R <= to) {
    lzy[i] += val;
    push(i, L, R);
    return;
  }
  int mid = L + R >> 1;
  upd(i << 1, L, mid, from, to, val);
  upd(i << 1 | 1, mid + 1, R, from, to, val);
  seg[i] = max(seg[i << 1], seg[i << 1 | 1]);
}
int get(int i, int L, int R) {
  push(i, L, R);
  if (seg[i] < 0) return -1;
  if (L == R) {
    if (seg[i] == 0) return L;
    return -1;
  }
  int mid = L + R >> 1;
  int ret = get(i << 1, L, mid);
  if (ret == -1) ret = get(i << 1 | 1, mid + 1, R);
  return ret;
}
int main() {
  scanf("%d %d", &n, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", a + i);
    upd(1, 1, n, i, i, +a[i]);
    upd(1, 1, n, i + 1, n, -a[i]);
  }
  while (q--) {
    long long x;
    int i;
    scanf("%d %lld", &i, &x);
    upd(1, 1, n, i, i, -a[i] + x);
    upd(1, 1, n, i + 1, n, +a[i] - x);
    a[i] = x;
    printf("%d\n", get(1, 1, n));
  }
  return 0;
}
