#include<bits/stdc++.h>
#define fi first
#define se second
using namespace std;

const int N = 1e5 + 10, mod = 1e9 + 7;
int n, m;
int a[N], b[N];
int cnt, top;
int s[N], f[N];
pair < int, int > p[N];
int c[N];

inline int read() {
	int s = 0, f = 1;
	char ch;
	for(; ch < '0' || ch > '9'; ch = getchar())	if(ch == '-')	f = -1;
	for(; ch >= '0' && ch <= '9'; ch = getchar())	s = (s << 1) + (s << 3) + ch - '0';
	return s * f;
}

inline bool mycmp(pair < int, int > a, pair < int, int > b) { return a.fi == b.fi ? a.se > b.se : a.fi < b.fi; }\

inline int lowbit(int x) { return x & -x; }

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

inline int ask(int x) {
	int re = 0;
	for(; x; x -= lowbit(x))	re = (re + c[x]) % mod;
	return re;
}

int main() {
	n = read(), m = read();
	for(int i = 1; i <= n; ++i)	a[i] = read();
	for(int i = 1; i <= m; ++i)	b[i] = read();
	for(int i = 1; i <= n; ++i) {
		if(a[i] < b[1] || a[i] >= b[m])	continue;
		int x = lower_bound(b + 1, b + m + 1, a[i]) - b;
		if(b[x] == a[i])	continue;
		p[++cnt] = make_pair(a[i] - b[x - 1], b[x] - a[i]);
		s[++top] = b[x] - a[i];
	}
	sort(s + 1, s + top + 1);
	top = unique(s + 1, s + top + 1) - s - 1;
	for(int i = 1; i <= cnt; ++i)	p[i].se = lower_bound(s + 1, s + top + 1, p[i].se) - s;
	sort(p + 1, p + cnt + 1, mycmp);
	cnt = unique(p + 1, p + cnt + 1) - p - 1;
	f[0] = 1;
	for(int i = 1; i <= cnt; ++i)
		f[i] = ask(p[i].se - 1) + 1, add(p[i].se, f[i]);
	int ans = 0;
	for(int i = 0; i <= cnt; ++i)	ans = (ans + f[i]) % mod;
	printf("%d\n", ans);
	return 0;
}