#include <bits/stdc++.h>
using namespace std;
class BinTree : public vector<long long> {
 public:
  explicit BinTree(int k = 0) { assign(k + 1, 0); }
  int lowbit(int k) { return k & -k; }
  long long sum(int k) { return k > 0 ? sum(k - lowbit(k)) + (*this)[k] : 0; }
  int last() { return size() - 1; }
  void add(int k, long long w) {
    if (k > last()) return;
    (*this)[k] += w;
    add(k + lowbit(k), w);
  }
  int find_king() {
    int start = 1;
    if ((*this).sum(1) == 0) return 1;
    while (start < last()) {
      int k = start;
      int begin = start + 1;
      int end = last();
      long long key = (*this).sum(start) * 2;
      if ((*this).sum(begin) == key) return begin;
      while (begin <= end) {
        int mid = (begin + end) >> 1;
        long long midkey = (*this).sum(mid);
        if (midkey >= key) {
          end = mid - 1;
        } else if (midkey < key) {
          k = mid;
          begin = mid + 1;
        }
      }
      if (k + 1 > last()) break;
      start = (k == start) ? k + 1 : k;
    }
    return -1;
  }
};
int main() {
  int n, q, tmp;
  int pos, val;
  scanf("%d%d", &n, &q);
  BinTree bintree(n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &tmp);
    bintree.add(i + 1, tmp);
  }
  for (int i = 0; i < q; ++i) {
    scanf("%d%d", &pos, &val);
    bintree.add(pos, (long long)val - bintree.sum(pos) + bintree.sum(pos - 1));
    printf("%d\n", bintree.find_king());
  }
  return 0;
}
