#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 1000;
int sqr, v[N], n, q;
int bk[N], start[N], stop[N];
long long Sm[N], Mx[N];
int t;
vector<pair<long long, int>> am[N];
void make(int buchet) {
  am[buchet].clear();
  Sm[buchet] = 0;
  Mx[buchet] = 0;
  long long Sum = 0;
  for (int i = start[buchet]; i <= stop[buchet]; ++i) {
    am[buchet].emplace_back(v[i] - Sum, i);
    Mx[buchet] = max(Mx[buchet], v[i] - Sum);
    Sum += v[i];
  }
  Sm[buchet] = Sum;
  sort(am[buchet].begin(), am[buchet].end());
}
int Find(vector<pair<long long, int>>& ala, long long val) {
  int l = -1, r = ala.size();
  while (l + 1 < r) {
    int m = (l + 1 + r) >> 1;
    if (ala[m].first < val) {
      l = m;
    } else {
      r = m;
    }
  }
  if (ala[r].first == val) return ala[r].second;
  return -1;
}
int Fnd() {
  long long actS = 0;
  for (int i = 1; i <= t; ++i) {
    if (Mx[i] >= actS) {
      int qt = Find(am[i], actS);
      if (qt != -1) return qt;
    }
    actS += Sm[i];
  }
  return -1;
}
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; ++i) scanf("%d", &v[i]);
  sqr = 256;
  t = 0;
  for (int i = 1; i <= n; i += sqr) {
    ++t;
    start[t] = i;
    stop[t] = min(i + sqr - 1, n);
    for (int j = i; j <= min(n, i + sqr - 1); ++j) {
      bk[j] = t;
    }
  }
  for (int i = 1; i <= t; i++) {
    am[t] = vector<pair<long long, int>>();
  }
  for (int i = 1; i <= t; ++i) make(i);
  for (int i = 1; i <= q; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    v[a] = b;
    make(bk[a]);
    printf("%d\n", Fnd());
  }
}
