#include <bits/stdc++.h>
#pragma optimize("", off)
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma comment(linker, "/STACK:36777216")
const int mod = 1000000007;
using namespace std;
template <class T>
void smin(T& a, T val) {
  if (a > val) a = val;
}
template <class T>
void smax(T& a, T val) {
  if (a < val) a = val;
}
template <typename T>
inline std::ostream& operator<<(std::ostream& os, const std::vector<T>& v) {
  bool first = true;
  os << "[";
  for (auto i : v) {
    if (!first) os << ", ";
    os << i;
    first = false;
  }
  return os << "]";
}
const int N = 2 * 1e5 + 10;
template <typename T>
struct fenwick_tree {
 private:
  int n;

 public:
  vector<T> a;
  void initialize(int k) {
    n = k;
    a.assign(n + 1, 0);
  }
  void update(int pos, T val) {
    for (; pos <= n; pos += pos & (-pos)) a[pos] += val;
  }
  T query(int pos) {
    T ans = 0;
    for (; pos >= 1; pos -= pos & (-pos)) ans += a[pos];
    return ans;
  }
  T get(int from, int to) { return query(to) - query(from - 1); }
};
fenwick_tree<long long> bit;
int n, q, a[N];
int lower_bound(long long x) {
  int index = 0;
  long long sum = 0;
  for (int i = (log2(n) + 1); i >= 0; --i) {
    if ((index + (1 << i)) <= n and (sum + bit.a[index + (1 << i)]) < x) {
      sum += bit.a[index + (1 << i)];
      index += (1 << i);
    }
  }
  return index + 1;
}
int solve() {
  if (a[1] == 0) return 1;
  long long m = a[1];
  while (1) {
    int idx = lower_bound(2 * m);
    if (idx > n) return -1;
    m = bit.query(idx);
    if (2 * a[idx] == m) {
      return idx;
    }
  }
}
int main() {
  scanf("%d%d", &n, &q);
  bit.initialize(n + 1);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", a + i);
    bit.update(i, a[i]);
  }
  while (q--) {
    int p, x;
    scanf("%d%d", &p, &x);
    bit.update(p, x - a[p]);
    a[p] = x;
    printf("%d\n", solve());
  }
  return 0;
}
