#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
struct node {
  long long mx;
  long long tag;
  int l, r;
} Node[N << 2];
long long a[N];
long long sum[N];
void pushup(int p) { Node[p].mx = max(Node[p << 1].mx, Node[p << 1 | 1].mx); }
void pushdown(int p) {
  if (Node[p].tag) {
    Node[p << 1].tag += Node[p].tag;
    Node[p << 1 | 1].tag += Node[p].tag;
    Node[p << 1].mx += Node[p].tag;
    Node[p << 1 | 1].mx += Node[p].tag;
    Node[p].tag = 0;
  }
}
void build(int p, int l, int r) {
  Node[p].l = l, Node[p].r = r;
  if (l == r) {
    Node[p].mx = a[l] - sum[l - 1];
    return;
  }
  int mid = (l + r) >> 1;
  build(p << 1, l, mid);
  build(p << 1 | 1, mid + 1, r);
  pushup(p);
}
void change1(int p, int l, int r, long long k) {
  if (Node[p].l >= l && Node[p].r <= r) {
    Node[p].mx += k;
    Node[p].tag += k;
    return;
  }
  pushdown(p);
  int mid = (Node[p].l + Node[p].r) >> 1;
  if (l <= mid) change1(p << 1, l, r, k);
  if (r > mid) change1(p << 1 | 1, l, r, k);
}
void change2(int p, int id, long long k) {
  if (Node[p].l == Node[p].r) {
    Node[p].mx += k;
    return;
  }
  pushdown(p);
  int mid = (Node[p].l + Node[p].r) >> 1;
  if (id <= mid)
    change2(p << 1, id, k);
  else
    change2(p << 1 | 1, id, k);
  pushup(p);
}
int query(int p, int l, int r) {
  if (l == r) {
    return Node[p].mx == 0 ? l : -1;
  }
  if (Node[p].mx < 0) {
    return -1;
  }
  pushdown(p);
  int mid = (l + r) >> 1;
  int la = query(p << 1, l, mid);
  return ~la ? la : query(p << 1 | 1, mid + 1, r);
}
int main() {
  int n, q;
  scanf("%d %d", &n, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    sum[i] = sum[i - 1] + a[i];
  }
  build(1, 1, n);
  while (q--) {
    int p;
    long long x;
    scanf("%d %lld", &p, &x);
    change1(1, p + 1, n, a[p] - x);
    change2(1, p, x - a[p]);
    a[p] = x;
    printf("%d\n", query(1, 1, n));
  }
  return 0;
}
