#include <bits/stdc++.h>
using namespace std;
namespace modular_space {
	long long mod;
	struct umod {
		long long val;
		umod(): val(0ll){}
		umod(long long x){ x %= mod; if(x < 0) x += mod; val = x; }
		umod& operator += (umod oth){ val += oth.val; if(val >= mod) val -= mod; return *this; }
		umod& operator -= (umod oth){ val -= oth.val; if(val < 0) val += mod; return *this; }
		umod& operator *= (umod oth){ val = val * oth.val % mod; return *this; }
		umod& operator /= (umod oth){ return *this *= oth.inverse(); }
		umod& operator ^= (long long oth){ return *this = pwr(*this, oth); }
		umod operator + (umod oth) const { return umod(*this) += oth; }
	       	umod operator - (umod oth) const { return umod(*this) -= oth; }
		umod operator * (umod oth) const { return umod(*this) *= oth; }
		umod operator / (umod oth) const { return umod(*this) /= oth; }
		umod operator ^ (long long oth) const { return umod(*this) ^= oth; }
		bool operator < (umod oth) const { return val < oth.val; }
		bool operator > (umod oth) const { return val > oth.val; }
		bool operator <= (umod oth) const { return val <= oth.val; }
		bool operator >= (umod oth) const { return val >= oth.val; }
		bool operator == (umod oth) const { return val == oth.val; }
		bool operator != (umod oth) const { return val != oth.val; }
		umod pwr(umod a, long long b) const {
			umod r = 1;
			for(; b; a *= a, b >>= 1)
				if(b&1)
					r *= a;
			return r;
		}
		umod inverse() const {
			long long a = val, b = mod, u = 1, v = 0;
			while(b){
				long long t = a/b;
				a -= t * b; swap(a, b);
				u -= t * v; swap(u, v);
			}
			if(u < 0)
				u += mod;
			return u;
		}
		friend istream& operator >> (istream &is, umod &oth);
		friend ostream& operator << (ostream &os, const umod& oth);
	};
	ostream& operator << (ostream &os, const umod &oth){
		os << oth.val;
		return os;
	}
	istream& operator >> (istream &is, umod &oth){
		long long x; is >> x;
		oth = umod(x);
		return is;
	}
	struct binprime_kit {
		int sz;
		vector<umod> fat, ifat;
		void init(int s){
			sz = s;
			fat.resize(sz + 1);
			ifat.resize(sz + 1);
			fat[0] = 1;
			for(int i = 1; i <= sz; i++) fat[i] = fat[i - 1] * i;
			ifat[sz] = fat[sz] ^ (mod - 2);
			for(int i = sz - 1; i >= 0; i--) ifat[i] = ifat[i + 1] * (i + 1);
		}
		umod coef(int n, int r){
			if(n < r) return 0;
			return fat[n] / (ifat[r] * ifat[n - r]);
		}
	};
};
template <typename T>
struct fenwick_tree{
	static const int DEFAULT = 200200;
	int size, off;
	vector<T> tree;
	fenwick_tree(int size = DEFAULT, int off = 0) : size(size), off(off) {
		clear();
	}
	void clear(){
		tree.assign(size, T());
	}
	void add(int pos, T v){
		for (pos += off; pos < size; pos += pos & -pos)
			tree[pos] = tree[pos] + v;
	}
	T sum(int pos){
		T r = T();
		for (pos += off; pos; pos -= pos & -pos)
			r = r + tree[pos];
		return r;
	}
	T query(int l, int r){
		return sum(r) - sum(l - 1);
	}
};
using U = modular_space::umod;
int main(){
	modular_space::mod = 1'000'000'007;
	int n, m; cin >> n >> m;
	vector<int> xs(n), ys(m);
	for(int i = 0; i < n; i++) cin >> xs[i];
	for(int i = 0; i < m; i++) cin >> ys[i];
	vector<pair<int, int> > vals;
	vector<int> comp;
	comp.push_back(0);
	for(int i = 0; i < n; i++){
		int p = lower_bound(ys.begin(), ys.end(), xs[i]) - ys.begin();
		if(p == 0 || p == m) continue;
		vals.push_back({xs[i] - ys[p - 1], ys[p] - xs[i]});
		comp.push_back(vals.back().first);
		comp.push_back(vals.back().second);
	}
	sort(vals.begin(), vals.end());
	vals.erase(unique(vals.begin(), vals.end()), vals.end());
	sort(comp.begin(), comp.end());
	comp.erase(unique(comp.begin(), comp.end()), comp.end());
	for(auto & e : vals){
		e.first = lower_bound(comp.begin(), comp.end(), e.first) - comp.begin();
		e.second = lower_bound(comp.begin(), comp.end(), e.second) - comp.begin();
	}
	fenwick_tree<U> tree(comp.size() + 2, 1);
	tree.add(0, U(1));
	int len = vals.size();
	for(int i = 0, j = 0; i < len; i = j){
		while(j < len && vals[j].first == vals[i].first) j++;
		vector<pair<int, U>> upd;
		for(int x = i; x < j; x++)
			upd.push_back({vals[x].second, tree.query(0, vals[x].second - 1)});
		for(auto e : upd)
			tree.add(e.first, e.second);
	}
	U ans = tree.sum(comp.size());
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3948