#include <bits/stdc++.h>
using namespace std;

namespace TYC
{
	typedef long long ll;

	const int N = 2e5 + 5, mod = 1e9 + 7;

	int n, m, cnt, A[N], B[N], R[N], X[N], Y[N], C[N];
	vector<int> P[N];

	inline int read()
	{
		int x = 0, f = 0, ch = getchar();
		while (!isdigit(ch))
			f |= (ch == '-'), ch = getchar();
		while (isdigit(ch))
			x = x * 10 + ch - '0', ch = getchar();
		return f ? -x : x;
	}

	void init()
	{
		int num = 0;
		for (int i = 1, j = 1; i <= n; i++)
			if (B[1] < A[i] && A[i] < B[m])
			{
				while (B[j + 1] <= A[i])
					j++;
				int x = A[i] - B[j], y = B[j + 1] - A[i];
				if (x && y)
				{
					R[++cnt] = X[++num] = x;
					R[++cnt] = Y[num] = y;
				}
			}
		sort(R + 1, R + 1 + cnt);
		cnt = unique(R + 1, R + 1 + cnt) - R - 1;
		for (int i = 1; i <= num; i++)
#define id(x) (lower_bound(R + 1, R + 1 + cnt, x) - R)
			P[id(X[i])].push_back(id(Y[i]));
#undef id
		for (int i = 1; i <= cnt; i++)
		{
			sort(P[i].begin(), P[i].end(), greater<int>());
			P[i].resize(unique(P[i].begin(), P[i].end()) - P[i].begin());
		}
		++cnt;
		P[cnt].push_back(cnt);
	}

#define lowbit(x) (x & (-x))

	inline int query(int x)
	{
		int sum = 0;
		for (; x; x -= lowbit(x))
			sum = (sum + C[x]) % mod;
		return sum;
	}

	inline void add(int x, const int v)
	{
		for (; x <= cnt; x += lowbit(x))
			C[x] = (C[x] + v) % mod;
	}

#undef lowbit

	void work()
	{
		n = read(), m = read();
		for (int i = 1; i <= n; i++)
			A[i] = read();
		for (int i = 1; i <= m; i++)
			B[i] = read();
		init();
		for (int i = 1; i <= cnt; i++)
			for (int p : P[i])
				add(p, (query(p - 1) + 1) % mod);	
		printf("%d\n", (query(cnt) - query(cnt - 1) + mod) % mod);
	}
}

int main()
{
	TYC::work();
	return 0;
}