#include <bits/stdc++.h>
using namespace std;
int const MAX = 2e5 + 41;
int n, q;
int a[MAX];
long long pref[MAX];
int p[MAX];
int x[MAX];
long long t[MAX * 4];
long long la[MAX * 4];
long long getvalue(int v) { return t[v] + la[v]; }
void push(int v) {
  if (la[v]) {
    la[v * 2 + 1] += la[v];
    la[v * 2 + 2] += la[v];
    la[v] = 0;
  }
}
void build(int v, int tl, int tr) {
  if (tl == tr) {
    t[v] = a[tl] - pref[tl - 1];
  } else {
    int tm = (tl + tr) / 2;
    build(v * 2 + 1, tl, tm);
    build(v * 2 + 2, tm + 1, tr);
    t[v] = max(getvalue(v * 2 + 1), getvalue(v * 2 + 2));
  }
}
int const INF = 1e9 + 41;
pair<int, int> getfirst(int v, int tl, int tr) {
  if (tl == tr) {
    return make_pair(getvalue(v), tl);
  } else {
    push(v);
    int tm = (tl + tr) / 2;
    pair<int, int> res = make_pair(-1, -1);
    if (getvalue(v * 2 + 1) >= 0) {
      res = getfirst(v * 2 + 1, tl, tm);
    } else {
      assert(getvalue(v * 2 + 2) >= 0);
      res = getfirst(v * 2 + 2, tm + 1, tr);
    }
    t[v] = max(getvalue(v * 2 + 1), getvalue(v * 2 + 2));
    return res;
  }
}
pair<int, int> const EMP = make_pair(INF, INF);
pair<int, int> getfirst(int v, int tl, int tr, int l, int r) {
  if (tl > r || l > tr) return EMP;
  if (l <= tl && tr <= r) {
    if (getvalue(v) < 0) {
      return EMP;
    }
    return getfirst(v, tl, tr);
  }
  push(v);
  int tm = (tl + tr) / 2;
  pair<int, int> v1 = getfirst(v * 2 + 1, tl, tm, l, r);
  if (v1.first >= 0 && v1.second != INF) {
    t[v] = max(getvalue(v * 2 + 1), getvalue(v * 2 + 2));
    return v1;
  }
  pair<int, int> v2 = getfirst(v * 2 + 2, tm + 1, tr, l, r);
  t[v] = max(getvalue(v * 2 + 1), getvalue(v * 2 + 2));
  return v2;
}
void upd(int v, int tl, int tr, int l, int r, int value) {
  if (tl > r || l > tr) return;
  if (l <= tl && tr <= r) {
    la[v] += value;
    return;
  }
  push(v);
  int tm = (tl + tr) / 2;
  upd(v * 2 + 1, tl, tm, l, r, value);
  upd(v * 2 + 2, tm + 1, tr, l, r, value);
  t[v] = max(getvalue(v * 2 + 1), getvalue(v * 2 + 2));
}
int ans[MAX];
void solve() {
  for (int i = 1; i <= n; i++) {
    pref[i] = pref[i - 1] + a[i];
  }
  build(0, 1, n);
  for (int i = 1; i <= q; i++) {
    int d = x[i] - a[p[i]];
    upd(0, 1, n, p[i], p[i], d);
    upd(0, 1, n, p[i] + 1, n, -d);
    a[p[i]] = x[i];
    int cur = -1;
    int l = 0;
    while (1) {
      pair<int, int> resp = getfirst(0, 1, n, l + 1, n);
      if (resp.first == 0) {
        cur = resp.second;
        break;
      }
      if (resp == EMP) break;
      l = resp.second;
    }
    ans[i] = cur;
  }
  for (int i = 1; i <= q; i++) {
    printf("%d\n", ans[i]);
  }
}
int main() {
  scanf("%d %d", &n, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 1; i <= q; i++) {
    scanf("%d %d", &p[i], &x[i]);
  }
  solve();
  return 0;
}
