#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long long N = 205;
const long long mod = 1000000007;
vector<long long> a;
struct FenwickTree {
  vector<long long> BIT;
  long long n;
  FenwickTree(long long n) {
    this->n = n + 1;
    BIT.assign(n + 1, 0);
    for (long long i = 1; i <= n; i++) add(i, a[i]);
  }
  void add(long long idx, long long delta) {
    for (; idx < n; idx += idx & (-idx)) BIT[idx] += delta;
  }
  long long sum(long long idx) {
    long long ret = 0;
    for (; idx > 0; idx -= idx & (-idx)) ret += BIT[idx];
    return ret;
  }
  long long sum(long long l, long long r) { return sum(r) - sum(l - 1); }
  long long Search(long long v) {
    long long sum = 0;
    long long pos = 0;
    long long LOGN = log2(n);
    for (long long i = LOGN; i >= 0; i--) {
      if (pos + (1 << i) < n && sum + BIT[pos + (1 << i)] < v) {
        sum += BIT[pos + (1 << i)];
        pos += (1 << i);
      }
    }
    return pos + 1;
  }
};
long long query() {}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, q;
  cin >> n >> q;
  a.resize(n + 1);
  for (long long i = 1; i <= n; i++) cin >> a[i];
  FenwickTree bit(n);
  while (q--) {
    long long idx, val;
    cin >> idx >> val;
    bit.add(idx, val - a[idx]);
    a[idx] = val;
    long long sum = 0, index;
    while (true) {
      index = bit.Search(2 * sum);
      if (index > n) {
        index = -1;
        break;
      }
      sum = bit.sum(index);
      if (2 * a[index] == sum) {
        break;
      }
    }
    cout << index << endl;
  }
  return 0;
}
