#include <bits/stdc++.h>
using namespace std;
const int MEA = 200005;
struct Result {
  int index;
  long long sum;
};
int n, q;
long long tree[MEA * 4];
long long a[MEA];
Result result(int id, long long s) {
  Result rs;
  rs.index = id;
  rs.sum = s;
  return rs;
}
void update(int node, int l, int r, int id, long long val) {
  if (id < l || id > r) return;
  if (l == r) {
    tree[node] = val;
    return;
  }
  int mid = (l + r) / 2;
  update(node * 2, l, mid, id, val);
  update(node * 2 + 1, mid + 1, r, id, val);
  tree[node] = tree[node * 2] + tree[node * 2 + 1];
}
long long getsum(int node, int l, int r, int L, int R) {
  if (L > r || l > R) return 0;
  if (L <= l && r <= R) return tree[node];
  int mid = (l + r) / 2;
  return getsum(node * 2, l, mid, L, R) +
         getsum(node * 2 + 1, mid + 1, r, L, R);
}
int binarySearch(int node, int l, int r, long long val) {
  if (l > r) return -1;
  if (l == r || val == 0) return l;
  int mid = (l + r) / 2;
  if (val > tree[node * 2]) {
    val -= tree[node * 2];
    return binarySearch(node * 2 + 1, mid + 1, r, val);
  } else
    return binarySearch(node * 2, l, mid, val);
}
int main() {
  ios::sync_with_stdio(NULL);
  cin.tie(NULL);
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    update(1, 1, n, i, a[i]);
  }
  while (q--) {
    int id;
    long long val;
    bool founded = false;
    cin >> id >> val;
    update(1, 1, n, id, val);
    a[id] = val;
    int k = 1;
    while (k <= n && !founded) {
      long long tempSum = getsum(1, 1, n, 1, k - 1);
      if (tempSum == a[k] && k <= n) {
        cout << k << '\n';
        founded = true;
        break;
      }
      int tempK = binarySearch(1, 1, n, tempSum * 2);
      if (tempK > k)
        k = tempK;
      else
        k++;
    }
    if (!founded) cout << "-1\n";
  }
}
