// Comment
// 정렬 방향을 잘 생각하면 풀 수 있다.

#include <bits/stdc++.h>

using namespace std;

#define SZ(v) ((int)(v).size())
#define ALL(v) (v).begin(),(v).end()
#define one first
#define two second
using ll = long long;
using pi = pair<int, int>;
const int INF = 0x3f3f3f3f;
const ll LINF = 1ll * INF * INF;

const int MOD = 1e9 + 7;

void add(int &a, int b) {
	a += b;
	if(a >= MOD) a -= MOD;
	if(a < 0) a += MOD;
}

struct BIT {
	int P; vector<int> val;
	BIT(int n) {
		P = n + 20;
		val = vector<int>(P, 0);
	}
	void update(int v, int k) {
		for(v+=10; v<P; v+=v&-v) add(val[v], k);
	}
	int getSum(int v) {
		int res = 0;
		for(v+=10; v>0; v-=v&-v) add(res, val[v]);
		return res;
	}
	int getSum(int a, int b) {
		int res = getSum(a) - getSum(b);
		add(res, 0);
		return res;
	}
};

int N, M;
vector<int> Nr, Mr;
vector<pi> Ps;
int main() {
	cin >> N >> M;
	Nr.resize(N), Mr.resize(M);
	for(int i=0; i<N; i++) scanf("%d", &Nr[i]);
	for(int i=0; i<M; i++) scanf("%d", &Mr[i]);
	vector<int> ys;
	for(int i=0; i<N; i++) {
		int ix = lower_bound(ALL(Mr), Nr[i]) - Mr.begin();
		if(ix == 0 || ix == M) continue;
		int dl = Nr[i] - Mr[ix-1];
		int dr = Mr[ix] - Nr[i];
		Ps.emplace_back(dl, dr);
		ys.push_back(dr);
	}
	ys.push_back(-INF);
	sort(ALL(ys));
	ys.erase(unique(ALL(ys)), ys.end());
	sort(ALL(Ps));
	Ps.erase(unique(ALL(Ps)), Ps.end());
	sort(ALL(Ps), [](pi a, pi b) {
		if (a.one == b.one) return a.two > b.two;
		return a.one < b.one;
	});

	BIT bit = BIT(SZ(ys));
	bit.update(0, 1);
	for(pi p: Ps) {
		int x, y; tie(x, y) = p;
		y = lower_bound(ALL(ys), y) - ys.begin();
		int add = bit.getSum(y-1);
		bit.update(y, add);
	}
	printf("%d\n", bit.getSum(SZ(ys)-1));
	return 0;
}
