#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const long long mod = 1000000007;
const int mxN = 200010;
const int mxL = 20;
long long BIT[mxN];
void upd(int ind, long long val) {
  while (ind < mxN) {
    BIT[ind] += val;
    ind |= ind + 1;
  }
}
long long get(int ind) {
  long long res = 0;
  while (ind >= 0) {
    res += BIT[ind];
    ind = (ind & (ind + 1)) - 1;
  }
  return res;
}
int find(long long need) {
  int pos = 0;
  for (int i = mxL - 1; i >= 0; i--) {
    if (pos + (1 << i) - 1 < mxN && BIT[pos + (1 << i) - 1] < need) {
      pos += (1 << i);
      need -= BIT[pos - 1];
    }
  }
  return pos - 1;
}
int main(int argc, char** argv) {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int N, Q, ind;
  cin >> N >> Q;
  long long x;
  vector<long long> a(N);
  for (int i = 0; i < N; i++) cin >> a[i], upd(i, a[i]);
  for (int i = 0; i < Q; i++) {
    cin >> ind >> x;
    ind--;
    upd(ind, x - a[ind]);
    a[ind] = x;
    if (a[0] == 0) {
      cout << "1\n";
      continue;
    }
    int cur = 0;
    while (cur + 1 < N) {
      long long s = get(cur);
      if (a[cur + 1] == s) {
        break;
      }
      int to = find(s * 2);
      cur = to + (cur == to);
    }
    if (cur + 1 < N)
      cout << cur + 2 << '\n';
    else
      cout << "-1\n";
  }
  return 0;
}
