#include <bits/stdc++.h>
using namespace std;
const int NMAX = 2e5 + 7;
long long n, q, a[NMAX];
long long t[4 * NMAX], lazy[4 * NMAX];
void _clear() {
  memset(t, 0, sizeof(t));
  memset(lazy, 0, sizeof(lazy));
}
void push_down(int node, int l, int r) {
  if (lazy[node]) {
    t[node] += lazy[node];
    if (l < r) {
      lazy[2 * node] += lazy[node];
      lazy[2 * node + 1] += lazy[node];
    }
    lazy[node] = 0;
  }
}
void update(int node, int st, int en, int l, int r, long long val) {
  push_down(node, st, en);
  if (st > en || l > en || r < st) return;
  if (l <= st && en <= r) {
    lazy[node] += val;
    push_down(node, st, en);
    return;
  }
  int mid = (st + en) / 2;
  update(2 * node, st, mid, l, r, val);
  update(2 * node + 1, mid + 1, en, l, r, val);
  t[node] = max(t[2 * node], t[2 * node + 1]);
}
int get(int node, int st, int en) {
  push_down(node, st, en);
  if (t[node] < 0) return -1;
  if (st == en) {
    if (t[node] == 0)
      return st;
    else
      return -1;
  }
  int mid = (st + en) / 2;
  int t1 = get(2 * node, st, mid);
  if (t1 != -1) return t1;
  return get(2 * node + 1, mid + 1, en);
}
int main() {
  scanf("%I64d%I64d", &n, &q);
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
    sum += a[i];
    update(1, 1, n, i, i, a[i]);
    if (i < n) update(1, 1, n, i + 1, n, -a[i]);
  }
  while (q--) {
    long long p, x;
    scanf("%I64d%I64d", &p, &x);
    if (p < n) update(1, 1, n, p + 1, n, a[p] - x);
    update(1, 1, n, p, p, x - a[p]);
    a[p] = x;
    printf("%d\n", get(1, 1, n));
  }
  return 0;
}
