#include <bits/stdc++.h>
using namespace std;
const int N = 200020;
int n, q, a[N];
namespace BIT {
long long t[N];
void add(int x, int v) {
  for (; x <= n; x += ((x) & -(x))) t[x] += v;
}
long long sum(int x) {
  long long rt = 0;
  for (; x; x -= ((x) & -(x))) rt += t[x];
  return rt;
}
}  // namespace BIT
using namespace BIT;
int query(long long x) {
  int rt = -1, l = 1, r = n;
  while (l <= r) {
    int m = l + r >> 1;
    if (sum(m) >= x)
      rt = m, r = m - 1;
    else
      l = m + 1;
  }
  return rt;
}
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), add(i, a[i]);
  for (int i = 1, pi, xi; i <= q; i++) {
    scanf("%d%d", &pi, &xi);
    add(pi, xi - a[pi]), a[pi] = xi;
    long long X = a[1], V;
    while (1) {
      int pos = query(X * 2);
      if (pos == -1) {
        printf("-1\n");
        break;
      } else if ((V = sum(pos)) == a[pos] * 2) {
        printf("%d\n", pos);
        break;
      } else
        X = V;
    }
  }
}
