#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int from, to, dist;
  Edge(int u, int v, int d) : from(u), to(v), dist(d) {}
};
struct Node {
  long long add;
  long long value, lazy;
  int l, r;
} nodes[200007 * 5];
int n, q, pos, fix;
long long sum[200007], a[200007];
long long value;
void build(int root, int l, int r) {
  nodes[root].l = l;
  nodes[root].r = r;
  if (l == r) {
    sum[l] = sum[l - 1] + a[l];
    nodes[root].value = a[l] - sum[l - 1];
    return;
  }
  int mid = (l + r) >> 1;
  build(root << 1, l, mid);
  build(root << 1 | 1, mid + 1, r);
  nodes[root].value = max(nodes[root << 1].value, nodes[root << 1 | 1].value);
}
void pushdown(int root) {
  if (nodes[root].lazy) {
    nodes[root << 1].lazy += nodes[root].lazy;
    nodes[root << 1 | 1].lazy += nodes[root].lazy;
    nodes[root << 1].value += nodes[root].lazy;
    nodes[root << 1 | 1].value += nodes[root].lazy;
    nodes[root].lazy = 0;
  }
}
void modify(int root, int l, int r, int val) {
  if (l <= nodes[root].l && nodes[root].r <= r) {
    nodes[root].lazy += val;
    nodes[root].value += val;
    return;
  }
  pushdown(root);
  int mid = (nodes[root].l + nodes[root].r) >> 1;
  if (r <= mid)
    modify(root << 1, l, r, val);
  else if (l > mid)
    modify(root << 1 | 1, l, r, val);
  else {
    modify(root << 1, l, mid, val);
    modify(root << 1 | 1, mid + 1, r, val);
  }
  nodes[root].value = max(nodes[root << 1].value, nodes[root << 1 | 1].value);
}
int query(int root) {
  if (nodes[root].value < 0) return -1;
  if (nodes[root].l == nodes[root].r)
    return nodes[root].value == 0 ? nodes[root].l : -1;
  pushdown(root);
  int res = -1;
  int mid = (nodes[root].l + nodes[root].r) >> 1;
  if (mid >= 1) res = query(root << 1);
  if (~res) return res;
  if (mid < n) res = query(root << 1 | 1);
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  sum[0] = 0;
  cin >> n >> q;
  for (int i = 1; i <= n; i++) cin >> a[i];
  build(1, 1, n);
  for (int i = 1; i <= q; i++) {
    cin >> pos >> fix;
    long long delta = fix - a[pos];
    a[pos] += delta;
    if (pos + 1 <= n) modify(1, pos + 1, n, -delta);
    modify(1, pos, pos, delta);
    int ans = query(1);
    cout << ans << endl;
  }
  return 0;
}
