#include<bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define pii pair<int, int>
using namespace std;
const int N = 1e5 + 10;
const int mod = 1e9 + 7;

int n, m, x[N], y[N], tr[N];
pii a[N];

bool cmp(pii a, pii b) {
	return (a.fi != b.fi) ? a.fi < b.fi : a.se > b.se;
}

void init() {
	int cnt = 0;
	cin >> n >> m;
	for (int i = 1; i <= n; ++i) scanf("%d", &x[i]);
	for (int i = 1; i <= m; ++i) scanf("%d", &y[i]);
	for (int i = 1; i <= n; ++i) {
		if (x[i] < y[1] || x[i] > y[m]) continue;
		int t = lower_bound(y + 1, y + m + 1, x[i]) - y;
		a[++cnt] = mp(x[i] - y[t - 1], y[t] - x[i]);
	}
	sort(a + 1, a + cnt + 1, cmp);
	n = unique(a + 1, a + cnt + 1) - a - 1;
	m = 0;
	for (int i = 1; i <= n; ++i) y[++m] = a[i].se;
	sort(y + 1, y + m + 1);
	m = unique(y + 1, y + m + 1) - y - 1;
	for (int i = 1; i <= n; ++i)
		a[i].se = lower_bound(y + 1, y + m + 1, a[i].se) - y; 
}

inline void Add(int x, int val) {
	for (++x; x < N; x += x & -x) {
		tr[x] += val;
		if (tr[x] >= mod) tr[x] -= mod;
	}
}

inline int Query(int x) {
	int res = 0;
	for (++x; x; x -= x & -x) {
		res += tr[x];
		if (res >= mod) res -= mod;
	}
	return res;
}

void Solve() {
	int res = 1;
	for (int i = 1; i <= n; ++i) {
		int del = Query(a[i].se - 1) + 1;
		res += del;
		if (res >= mod) res -= mod;
		Add(a[i].se, del);
	}
	cout << res << endl;
}

int main() {
	init();
	Solve();
	return 0;
}
