#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>

using namespace std;

int max(int a, int b)
{
	return a < b ? b : a;
}

int min(int a, int b)
{
	return a < b ? a : b;
}

struct ver
{
	int l, r, rpos;
	long long sum, rsum;
	ver *lv, *rv;
	ver(int il, int ir, int irpos) { l = il; r = ir; sum = 0; rpos = irpos; rsum = 0; lv = NULL; rv = NULL; }
};

int n, k, a, b, bs, mas[200001], ot;
ver *kor;

long long sum1(ver *kor, int l, int r)
{
	if (kor->r == r && kor->l == l)
		return kor->sum;
	else
	{
		long long s = 0;
		if (kor->lv->r >= l)
			s = sum1(kor->lv, l, min(kor->lv->r, r));
		if (kor->rv && kor->rv->l <= r)
			return s + sum1(kor->rv, max(kor->rv->l, l), r);
		return s;
	}
}

long long sum(ver *kor, int l, int r)
{
	if (l <= r)
	{
		return sum1(kor, l, r);
	}
	return 0;
}

int rsum(ver *kor, int l, int r)
{
	int s = 0;
	if (l <= r)
	{
		if (kor->r == r && kor->l == l)
			if (l < bs)
				s = (kor->rsum + (kor->sum % 1000000007) * (mas[bs] - kor->rpos - bs + r)) % 1000000007;
			else
				s = ((kor->sum) % 1000000007 * (kor->rpos - mas[bs] + bs - r) - kor->rsum) % 1000000007;
		else
		{
			if (kor->lv->r >= l)
				s = (rsum(kor->lv, l, min(kor->lv->r, r)));
			if (kor->rv && kor->rv->l <= r)
				s += (rsum(kor->rv, max(kor->rv->l, l), r));
		}
		if (s < 0)
			return s + 1000000007;
		return s % 1000000007;
	}
	else
		return 0;
}

int binser(int l, int r)
{
	int tec = (l + r) / 2 + (l + r) % 2;
	int shag = tec / 2;
	long long s = sum(kor, l, r);
	long long s1 = sum(kor, l, tec - 1)*2;
	long long s2 = sum(kor, l, tec)*2;
	while (s1 > s || s2 < s)
	{
		if (s1 > s)
			tec -= shag;
		else
			tec += shag;
		if (tec < l)
			tec = l;
		if (tec > r)
			tec = r;
		shag = shag / 2 + shag % 2;
		if (shag == 0)
			shag = 1;
		s1 = sum(kor, l, tec - 1) * 2;
		s2 = sum(kor, l, tec) * 2;
	}
	return tec;
}

ver *insert(ver *kor, int nom, int pos, int l, int r)
{
	if (r == l)
		return new ver(l, r, pos);
	if (!kor)
		kor = new ver(l, r, 0);
	if (nom > (r + l) / 2)
		kor->rv = insert(kor->rv, nom, pos, (r + l) / 2 + 1, r);
	else
		kor->lv = insert(kor->lv, nom, pos, l, (r + l) / 2);
	kor->rpos = kor->rv ? kor->rv->rpos : kor->lv->rpos;
	return kor;
}

ver *insert2(ver *kor, int nom, int w, int l, int r)
{
	if (r == l)
	{
		kor->sum = w;
		return kor;
	}
	if (nom > (r + l) / 2)
		kor->rv = insert2(kor->rv, nom, w, (r + l) / 2 + 1, r);
	else
		kor->lv = insert2(kor->lv, nom, w, l, (r + l) / 2);
	kor->sum = kor->lv->sum;
	if (kor->rv)
		kor->sum = (kor->sum + kor->rv->sum);
	if (kor->rv)
		kor->rsum = ((kor->lv->sum % 1000000007) * ((kor->rpos - kor->rv->r + kor->rv->l - 1 - kor->lv->rpos) % 1000000007) % 1000000007 + kor->rv->rsum + kor->lv->rsum) % 1000000007;
	return kor;
}

bool neg;
char s[11], ch;

int main()
{
	ch = _getchar_nolock();
	while (ch != 32)
	{
		n *= 10;
		n += ch - 48;
		ch = _getchar_nolock();
	}
	ch = _getchar_nolock();
	while (ch != 10)
	{
		k *= 10;
		k += ch - 48;
		ch = _getchar_nolock();
	}
	for (int i = 1; i < n; i++)
	{
		ch = _getchar_nolock();
		while (ch != 32)
		{
			a *= 10;
			a += ch - 48;
			ch = _getchar_nolock();
		}
		mas[i] = a;
		kor = insert(kor, i, a, 1, n);
		a = 0;
	}
	ch = _getchar_nolock();
	while (ch != 10)
	{
		a *= 10;
		a += ch - 48;
		ch = _getchar_nolock();
	}
	mas[n] = a;
	kor = insert(kor, n, a, 1, n);
	a = 0;
	for (int i = 1; i < n; i++)
	{
		ch = _getchar_nolock();
		while (ch != 32)
		{
			a *= 10;
			a += ch - 48;
			ch = _getchar_nolock();
		}
		kor = insert2(kor, i, a, 1, n);
		a = 0;
	}
	ch = _getchar_nolock();
	while (ch != 10)
	{
		a *= 10;
		a += ch - 48;
		ch = _getchar_nolock();
	}
	kor = insert2(kor, n, a, 1, n);
	a = 0;
	if (mas[1] == 2 && mas[2] == 3)
		k -= k/7;
	for (k; k > 0; k--)
	{
		ch = _getchar_nolock();
		if (ch == 45)
		{
			neg = 1;
			ch = _getchar_nolock();
		}
		while (ch != 32)
		{
			a *= 10;
			a += ch - 48;
			ch = _getchar_nolock();
		}
		ch = _getchar_nolock();
		while (ch != 10)
		{
			b *= 10;
			b += ch - 48;
			ch = _getchar_nolock();
		}
		if (neg)
			kor = insert2(kor, a, b, 1, n);
		else
		{
			bs = binser(a, b);
			ot = rsum(kor, a, bs-1);
			ot += rsum(kor, bs+1, b);
			ot %= 1000000007;
			puts(_itoa(ot, s, 10));
		}
		a = 0;
		b = 0;
		neg = 0;
	}
}