#include <bits/stdc++.h>
using namespace std;
template <typename T>
class fenwick {
 public:
  int n;
  vector<T> tr;
  fenwick(int _n) : n(_n) { tr = vector<T>(n); }
  void update(int x, T v) {
    while (x < n) {
      tr[x] += v;
      x |= (x + 1);
    }
  }
  T sum(int k) {
    T s = 0;
    while (k >= 0) {
      s += tr[k];
      k = (k & (k + 1)) - 1;
    }
    return s;
  }
  T get(int i) { return sum(i) - sum(i - 1); }
  int lower_bound(T x) {
    int k;
    for (k = 0; 1 << (k + 1) <= n; k++)
      ;
    int res = 0;
    for (; k >= 0; k--) {
      int p = res + (1 << k) - 1;
      if (p < n && tr[p] < x) {
        x -= tr[p];
        res += 1 << k;
      }
    }
    return res;
  }
};
void foo() {
  int n, q;
  cin >> n >> q;
  fenwick<long long> f(n);
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    f.update(i, a);
  }
  for (int i = 0; i < q; i++) {
    int ind, x;
    cin >> ind >> x;
    ind--;
    long long old = f.get(ind);
    f.update(ind, x - old);
    long long sum = 0;
    int ans = -1;
    while (true) {
      int left = f.lower_bound(sum * 2);
      if (left == n) break;
      long long nsum = f.sum(left);
      if (nsum == 2 * f.sum(left - 1)) {
        ans = left;
        break;
      }
      sum = nsum;
    }
    if (ans != -1) {
      ans++;
    }
    cout << ans << endl;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  foo();
}
