#include <bits/stdc++.h>
using namespace std;
int n, q, a[200007];
long long tr[200007 << 2], lazy[200007 << 2], sum[200007], ans;
void update(int num) { tr[num] = max(tr[num << 1], tr[num << 1 | 1]); }
void pushdown(int num) {
  if (lazy[num]) {
    tr[num << 1] += lazy[num], tr[num << 1 | 1] += lazy[num];
    lazy[num << 1] += lazy[num], lazy[num << 1 | 1] += lazy[num];
    lazy[num] = 0;
  }
}
void build(int num, int l, int r) {
  if (l == r) {
    tr[num] = sum[l];
    return;
  }
  int mid = l + r >> 1;
  build(num << 1, l, mid), build(num << 1 | 1, mid + 1, r);
  update(num);
}
void change(int num, int l, int r, int x, int y, long long k) {
  if (x <= l && r <= y) {
    tr[num] += k;
    lazy[num] += k;
    return;
  }
  pushdown(num);
  int mid = l + r >> 1;
  if (x <= mid) change(num << 1, l, mid, x, y, k);
  if (y > mid) change(num << 1 | 1, mid + 1, r, x, y, k);
  update(num);
}
int getpos(int num, int l, int r, long long k) {
  if (l == r) {
    ans = tr[num];
    return l;
  };
  pushdown(num);
  int mid = l + r >> 1;
  if (tr[num << 1] >= k) return getpos(num << 1, l, mid, k);
  return getpos(num << 1 | 1, mid + 1, r, k);
}
int work() {
  long long w = 0;
  int now = 0;
  while (now != n) {
    int res = getpos(1, 1, n, (long long)2 * w);
    if (ans == (long long)2 * a[res]) return res;
    now = res;
    w = ans;
  }
  return -1;
}
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + (long long)a[i];
  build(1, 1, n);
  while (q--) {
    int x;
    long long k;
    scanf("%d%lld", &x, &k);
    change(1, 1, n, x, n, k - (long long)a[x]), a[x] = k;
    printf("%d\n", work());
  }
}
