#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int n, q;
long long a[N], f[N], t[4 * N];
void update(int p, long long v) {
  long long add = v - a[p];
  a[p] = v;
  while (p < N) f[p] += add, p += p & -p;
}
long long get(int p) {
  long long res = 0;
  while (p > 0) res += f[p], p -= p & -p;
  return res;
}
void update(int u, int b, int e, int p, long long v) {
  if (p < b or p > e) return;
  if (b == e) {
    t[u] = v;
    return;
  }
  int m = b + e >> 1;
  update(u + u, b, m, p, v);
  update(u + u + 1, m + 1, e, p, v);
  t[u] = max(t[u + u], t[u + u + 1]);
}
int query(int u, int b, int e, int p, long long v) {
  if (e < p) return -1;
  if (b == e) return b;
  int m = b + e >> 1, res = -1;
  if (t[u + u] >= v) res = query(u + u, b, m, p, v);
  if (res == -1 and t[u + u + 1] >= v) res = query(u + u + 1, m + 1, e, p, v);
  return res;
}
int main() {
  scanf("%d %d", &n, &q);
  for (int i = 1; i <= n; ++i) {
    long long x;
    scanf("%lld", &x);
    update(i, x);
    update(1, 1, n, i, x);
  }
  while (q--) {
    int p;
    long long x;
    scanf("%d %lld", &p, &x);
    update(p, x);
    update(1, 1, n, p, x);
    int at = 1, ans = -1;
    while (at != -1) {
      long long sum = get(at - 1);
      if (sum == a[at]) {
        ans = at;
        break;
      }
      at = query(1, 1, n, at + 1, sum);
    }
    printf("%d\n", ans);
  }
  return 0;
}
