#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring> 
#include <cmath> 
#include <algorithm>
using namespace std; 
inline int gi() {
    register int data = 0, w = 1;
    register char ch = 0;
    while (!isdigit(ch) && ch != '-') ch = getchar(); 
    if (ch == '-') w = -1, ch = getchar(); 
    while (isdigit(ch)) data = 10 * data + ch - '0', ch = getchar(); 
    return w * data; 
} 
const int MAX_N = 1e5 + 5; 
const int Mod = 1e9 + 7; 
int N, M, n, x[MAX_N], y[MAX_N], f[MAX_N]; 
int o[MAX_N], m; 
pair<int, int> p[MAX_N]; 
int c[MAX_N]; 
inline int lb(int x) { return x & -x; } 
void add(int x, int v) { while (x <= m) c[x] = (c[x] + v) % Mod, x += lb(x); } 
int sum(int x) { int res = 0; while (x) res = (res + c[x]) % Mod, x -= lb(x); return res; } 
bool cmp(pair<int, int> l, pair<int, int> r) { 
	if (l.first == r.first) return l.second > r.second;
	else return l.first < r.first; 
} 
int main () { 
	N = gi(), M = gi(); 
	for (int i = 1; i <= N; i++) x[i] = gi(); 
	for (int i = 1; i <= M; i++) y[i] = gi(); 
	for (int i = 1; i <= N; i++) { 
		if (x[i] < y[1] || x[i] > y[M]) continue; 
		int pos = lower_bound(&y[1], &y[M + 1], x[i]) - y; 
		if (y[pos] == x[i]) continue; 
		p[++n] = make_pair(x[i] - y[pos - 1], y[pos] - x[i]); 
		o[++m] = y[pos] - x[i]; 
	} 
	sort(&o[1], &o[m + 1]); 
	m = unique(&o[1], &o[m + 1]) - o - 1; 
	sort(&p[1], &p[n + 1], cmp); 
	n = unique(&p[1], &p[n + 1]) - p - 1; 
	for (int i = 1; i <= n; i++) p[i].second = lower_bound(&o[1], &o[m + 1], p[i].second) - o;
	for (int i = 1; i <= n; i++) { 
		f[i] = (sum(p[i].second - 1) + 1) % Mod; 
		add(p[i].second, f[i]); 
	} 
	int ans = 1;
 	for (int i = 1; i <= n; i++) ans = (ans + f[i]) % Mod; 
	printf("%d\n", ans); 
    return 0; 
} 