#include <bits/stdc++.h>
using namespace std;
int TM;
struct Data {
  long long mx, lazy;
  Data() { mx = lazy = 0LL; }
};
Data nod[4 * 200005];
int N = 200005 - 3;
void update_node(int cur, int L, int R, long long val) {
  nod[cur].mx += val;
  nod[cur].lazy += val;
}
void lazy_update(int cur, int L, int R) {
  update_node(2 * cur, L, ((L + R) >> 1), nod[cur].lazy);
  update_node(2 * cur + 1, ((L + R) >> 1) + 1, R, nod[cur].lazy);
  nod[cur].lazy = 0;
}
void update(int st, int ed, long long val, int cur = 1, int L = 1, int R = N) {
  if (st > R || ed < L) return;
  if (st <= L && ed >= R) return update_node(cur, L, R, val);
  if (nod[cur].lazy) lazy_update(cur, L, R);
  update(st, ed, val, 2 * cur, L, ((L + R) >> 1));
  update(st, ed, val, 2 * cur + 1, ((L + R) >> 1) + 1, R);
  nod[cur].mx = max(nod[2 * cur].mx, nod[2 * cur + 1].mx);
}
int findPos(int cur = 1, int L = 1, int R = N) {
  if (L == R) return nod[cur].mx == 0 ? L : -1;
  if (nod[cur].lazy) lazy_update(cur, L, R);
  if (nod[2 * cur].mx >= 0) {
    int ans = findPos(2 * cur, L, ((L + R) >> 1));
    if (ans != -1) return ans;
  }
  if (nod[2 * cur + 1].mx >= 0) {
    int ans = findPos(2 * cur + 1, ((L + R) >> 1) + 1, R);
    if (ans != -1) return ans;
  }
  return -1;
}
int main() {
  int q, arr[200005], el;
  scanf("%d", &N);
  scanf("%d", &q);
  long long tot = 0;
  for (int i = 1; i <= N; i++) {
    scanf("%d", &el);
    update(i, i, (long long)el - tot);
    tot += el;
    arr[i] = el;
  }
  while (q--) {
    int in;
    long long val, cur, ext;
    scanf("%d", &in);
    scanf("%lld", &val);
    cur = arr[in];
    arr[in] = val;
    ext = val - cur;
    update(in, in, ext);
    if (in < N) update(in + 1, N, -1 * ext);
    printf("%d\n", findPos());
  }
  return 0;
}
