#include <bits/stdc++.h>
const int maxn = 2e5 + 5;
int n, q;
inline int lowbit(int x) { return x & (-x); }
long long bit[maxn];
void add(int pos, long long v) {
  for (int i = pos; i <= n; i += lowbit(i)) bit[i] += v;
}
long long querybit(int pos) {
  long long ans = 0;
  for (int i = pos; i; i -= lowbit(i)) ans += bit[i];
  return ans;
}
long long mv[maxn << 2], a[maxn];
void updata(int rt) { mv[rt] = std::max(mv[rt << 1], mv[rt << 1 | 1]); }
void build(int l, int r, int rt) {
  if (l == r) {
    mv[rt] = a[l];
    return;
  }
  int mid = (l + r) >> 1;
  build(l, mid, rt << 1);
  build(mid + 1, r, rt << 1 | 1);
  updata(rt);
}
void modify(int l, int r, int rt, int pos, long long v) {
  if (l == r) {
    mv[rt] = v;
    return;
  }
  int mid = (l + r) >> 1;
  if (pos <= mid)
    modify(l, mid, rt << 1, pos, v);
  else
    modify(mid + 1, r, rt << 1 | 1, pos, v);
  updata(rt);
}
int query(int l, int r, int rt, int pos, long long v) {
  if (mv[rt] < v || pos > n) return n + 1;
  if (l == r) return l;
  int mid = (l + r) >> 1;
  if (pos <= l) {
    if (mv[rt << 1] >= v)
      return query(l, mid, rt << 1, pos, v);
    else
      return query(mid + 1, r, rt << 1 | 1, pos, v);
  } else {
    if (pos <= mid)
      return std::min(query(l, mid, rt << 1, pos, v),
                      query(mid + 1, r, rt << 1 | 1, pos, v));
    else
      return query(mid + 1, r, rt << 1 | 1, pos, v);
  }
}
int search(int pos) {
  if (pos > n) return -1;
  if (querybit(pos - 1) == a[pos]) return pos;
  return search(query(1, n, 1, pos + 1, querybit(pos)));
}
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]), add(i, a[i]);
  build(1, n, 1);
  while (q--) {
    int tp;
    long long tv;
    scanf("%d%lld", &tp, &tv);
    add(tp, tv - a[tp]);
    a[tp] = tv;
    modify(1, n, 1, tp, tv);
    printf("%d\n", search(1));
  }
  return 0;
}
