#include <bits/stdc++.h>
using namespace std;
unsigned int n, q, w[200001], p[200001];
unsigned long long S[200001];
int t, m;
int main() {
  cin >> n >> q;
  for (unsigned int i = 1; i <= n; ++i) cin >> p[i];
  for (unsigned int i = 1; i <= n; ++i) cin >> w[i];
  for (unsigned int i = 1; i <= n; ++i) S[i] = S[i - 1] + w[i];
  for (; 0 < q; --q) {
    cin >> t >> m;
    if (t < 0) {
      int q = -w[-t] + m;
      w[-t] = m;
      if (q != 0)
        for (unsigned int i = -t; i <= n; ++i) S[i] = S[i] + q;
    } else {
      unsigned int A = m - t, sum = 0;
      for (unsigned int i = t; A > 0; ++i, --A) {
        unsigned int dif = p[i + 1] - p[i] - 1;
        if (dif != 0) {
          unsigned long long H =
              (min(S[m] - S[i], S[i] - S[t - 1])) % 1000000007;
          int k = H % 100;
          sum += (unsigned long long)(100 * ((H / 100 * dif) % 1000000007) %
                                          1000000007 +
                                      (k * dif) % 1000000007) %
                 1000000007;
        }
      }
      cout << sum << '\n';
    }
  }
}
