# include <bits/stdc++.h>
 
/*
// ordered_set 
# include <ext/pb_ds/assoc_container.hpp>
# include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
# define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
*/
 
using namespace std;
 
typedef long long                                        ll;
typedef long double                                      ld;
typedef pair <int, int>                                  pii;
typedef pair <pii, int>                                  ppi;
typedef pair <int, pii>                                  pip;
typedef pair <pii, pii>                                  ppp;
typedef pair <ll, ll>                                    pll;
 
# define A                                               first
# define B                                               second
# define endl                                            '\n'
# define sep                                             ' '
# define all(x)                                          x.begin(), x.end()
# define kill(x)                                         return cout << x << endl, 0
# define SZ(x)                                           int(x.size())
# define Sort(x)                                         sort(all(x))
# define InTheNameOfGod                                  ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
 
ll power(ll a, ll b, ll md) {return (!b ? 1 : (b & 1 ? a * power(a * a % md, b / 2, md) % md : power(a * a % md, b / 2, md) % md));}

const int xn = 5e5 + 10;
const int xm = - 20 + 10;
const int SQ = 320;
const int sq = 320 + 10;
const int inf = 1e9 + 10;
const ll INF = 1e18 + 10;
const int mod = 1e9 + 7;
const int TM = 3;
const int base = 257;

int n, m, a[xn], b[xn], seg[xn << 2], ptr = 1;
pii d[xn];
unordered_map <int, int> mp;
vector <int> compress;

bool cmp(pii i, pii j){
	if (i.A != j.A) return i.A < j.A;
	return i.B > j.B;
}
void modify(int id, int l, int r, int pos, int val){
	if (r - l == 1){
		seg[id] = (seg[id] + val) % mod;
		return;
	}
	int mid = l + r >> 1;
	if (pos < mid) modify(id << 1, l, mid, pos, val);
	else modify(id << 1 | 1, mid, r, pos, val);
	seg[id] = (seg[id << 1] + seg[id << 1 | 1]) % mod;
}
int get (int id, int l, int r, int ql, int qr){
	if (qr <= l || r <= ql) return 0;
	if (ql <= l && r <= qr) return seg[id];
	int mid = l + r >> 1;
	return (get(id << 1, l, mid, ql, qr) + get(id << 1 | 1, mid, r, ql, qr)) % mod;
}

int main(){
    InTheNameOfGod;
    
	cin >> n >> m;
	for (int i = 1; i <= n; ++ i) cin >> a[i];
	for (int i = 1; i <= m; ++ i) cin >> b[i];
	for (int i = 1; i <= n; ++ i){
		int l = 0, r = m + 1, mid;
		while (r - l > 1){
			mid = l + r >> 1;
			if (b[mid] < a[i]) l = mid;
			else r = mid;
		}
		if (!l || r > m) continue;
		d[i] = {a[i] - b[l], b[r] - a[i]};
		compress.push_back(d[i].A);
		compress.push_back(d[i].B);
	}
	sort(all(compress));
	for (int i = 0; i < compress.size(); ++ i){
		if (i && compress[i] == compress[i - 1]) continue;
		mp[compress[i]] = ptr ++;
	}
	for (int i = 1; i <= n; ++ i){
		d[i].A = mp[d[i].A];
		d[i].B = mp[d[i].B];
	}
	sort(d + 1, d + n + 1, cmp);
	modify(1, 0, ptr, 0, 1);
	for (int i = 1; i <= n; ++ i){
		if (!d[i].A || !d[i].B || d[i] == d[i - 1]) continue;
		modify(1, 0, ptr, d[i].B, get(1, 0, ptr, 0, d[i].B));
	}
	cout << seg[1] << endl;
	
    return 0;
}


Measured memory_bytes: 15516