#include <bits/stdc++.h>
using namespace std;
const double PI = 2 * acos(0.0);
template <typename T>
struct edge {
  int from, to;
  T w;
  edge(int from, int to, T w) : from(from), to(to), w(w) {}
  edge() {}
};
const double EPS = 1e-9;
template <class T>
void show(T a) {
  for (auto x : a) cout << x << " ";
  cout << endl;
}
const int N = 2e5 + 9;
const long long oo = 1e18;
const long long M = 1e9 + 7;
int pw_double[N], pa_double[N];
double tw_double[N], ta_double[N];
inline void updw_double(int i, double w) {
  double tmp = w;
  w -= pw_double[i];
  pw_double[i] = tmp;
  for (++i; i < N; i += i & -i) tw_double[i] += w;
}
inline void upda_double(int i, double a) {
  double tmp = a;
  a -= pa_double[i];
  pa_double[i] = tmp;
  for (++i; i < N; i += i & -i) ta_double[i] += a;
}
double getw_double(int i) {
  double ret = 0;
  for (; i > 0; i -= i & -i) ret += tw_double[i];
  return ret;
}
double getw_double(int l, int r) {
  if (l > r) return 0;
  ++r;
  if (l) return getw_double(r) - getw_double(l);
  return getw_double(r);
}
double geta_double(int i) {
  double ret = 0;
  for (; i > 0; i -= i & -i) ret += ta_double[i];
  return ret;
}
double geta_double(int l, int r) {
  if (l > r) return 0;
  ++r;
  if (l) return geta_double(r) - geta_double(l);
  return geta_double(r);
}
int pw[N], pa[N];
int tw[N], ta[N];
inline void updw(int i, int w) {
  int tmp = w;
  w = ((w) - (pw[i]) < 0 ? (w) - (pw[i]) + M : (w) - (pw[i]));
  pw[i] = tmp;
  for (++i; i < N; i += i & -i)
    tw[i] = ((tw[i]) + (w) >= M ? (tw[i]) + (w)-M : (tw[i]) + (w));
}
inline void upda(int i, int w) {
  int tmp = w;
  w = ((w) - (pa[i]) < 0 ? (w) - (pa[i]) + M : (w) - (pa[i]));
  pa[i] = tmp;
  for (++i; i < N; i += i & -i)
    ta[i] = ((ta[i]) + (w) >= M ? (ta[i]) + (w)-M : (ta[i]) + (w));
}
inline int getw(int i) {
  int ret = 0;
  for (; i > 0; i -= i & -i)
    ret = ((ret) + (tw[i]) >= M ? (ret) + (tw[i]) - M : (ret) + (tw[i]));
  return ret;
}
inline int getw(int l, int r) {
  if (l > r) return 0;
  ++r;
  int a = getw(r), b = getw(l);
  return ((a) - (b) < 0 ? (a) - (b) + M : (a) - (b));
}
inline int geta(int i) {
  int ret = 0;
  for (; i > 0; i -= i & -i)
    ret = ((ret) + (ta[i]) >= M ? (ret) + (ta[i]) - M : (ret) + (ta[i]));
  return ret;
}
inline int geta(int l, int r) {
  if (l > r) return 0;
  ++r;
  int a = geta(r), b = geta(l);
  return ((a) - (b) < 0 ? (a) - (b) + M : (a) - (b));
}
int a[N];
int n, q;
inline int bins(long long xl) {
  int l = -1, r = n;
  while (r - l > 1) {
    int m = (l + r) >> 1;
    if (xl + m - a[m] >= 0)
      l = m;
    else
      r = m;
  }
  return r;
}
inline double get_double(int xx, int l, int r) {
  int pos = bins(xx - l);
  double x = xx;
  return (getw_double(l, min(pos - 1, r)) - getw_double(max(l, pos), r)) *
             (x - l) +
         geta_double(l, min(pos - 1, r)) - geta_double(max(pos, l), r);
}
inline long long get(long long x, long long l, long long r) {
  long long pos = bins(x - l);
  long long tmp = getw(l, min(pos - 1, r));
  long long plus =
      (((tmp) * (((x) - (l) < 0 ? (x) - (l) + M : (x) - (l)))) % M);
  tmp = geta(l, min(pos - 1, r));
  plus = ((plus) + (tmp) >= M ? (plus) + (tmp)-M : (plus) + (tmp));
  tmp = getw(max(l, pos), r);
  long long minus =
      (((tmp) * (((x) - (l) < 0 ? (x) - (l) + M : (x) - (l)))) % M);
  tmp = geta(max(pos, l), r);
  minus = ((minus) + (tmp) >= M ? (minus) + (tmp)-M : (minus) + (tmp));
  return ((plus) - (minus) < 0 ? (plus) - (minus) + M : (plus) - (minus));
}
inline bool check(long long x, long long l, long long r) {
  double a = get_double(x, l, r), b = get_double(x + 1, l, r);
  return a > b || abs(a - b) < EPS;
}
long long solve(long long L, long long R) {
  long long l = -1, r = 1e9 + 9;
  while (r - l > 1) {
    long long m = (l + r) >> 1;
    if (check(m, L, R))
      l = m;
    else
      r = m;
  }
  return get(r, L, R);
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> q;
  for (long long i = 0; i < (long long)(n); ++i) cin >> a[i];
  for (long long i = 0; i < (long long)(n); ++i) {
    long long w;
    cin >> w;
    updw(i, w);
    upda(i, ((((long long)w) *
              (((i) - (a[i]) < 0 ? (i) - (a[i]) + M : (i) - (a[i])))) %
             M));
    updw_double(i, w);
    upda_double(i, (double)w * ((double)i - (double)a[i]));
  }
  while (q--) {
    long long x, y;
    cin >> x >> y;
    if (x < 0) {
      x = -x - 1;
      updw(x, y);
      upda(x, ((((long long)y) *
                (((x) - (a[x]) < 0 ? (x) - (a[x]) + M : (x) - (a[x])))) %
               M));
      updw_double(x, y);
      upda_double(x, (double)y * ((double)x - (double)a[x]));
    } else {
      cout << solve(--x, --y) << "\n";
    }
  }
}
