#include<bits/stdc++.h>
using namespace std;

int read(){
	int a = 0; char c = getchar();
	while(!isdigit(c)) c = getchar();
	while(isdigit(c)){a = a * 10 + c - 48; c = getchar();}
	return a;
}

#define PII pair < int , int >
const int _ = 1e5 + 7 , MOD = 1e9 + 7;
int arr[_] , x[_] , y[_] , N , M;
vector < PII > dist; vector < int > lsh;

void inc(int &a , int b){a = a + b >= MOD ? a + b - MOD : a + b;}

namespace BIT{
	int arr[_];
#define lowbit(x) ((x) & -(x))
	void add(int x , int val){while(x <= N + 1){inc(arr[x] , val); x += lowbit(x);}}
	int qry(int x){int sum = 0; while(x){inc(sum , arr[x]); x -= lowbit(x);} return sum;}
}

int main(){
	N = read(); M = read();
	for(int i = 1 ; i <= N ; ++i) x[i] = read();
	for(int i = 1 ; i <= M ; ++i) y[i] = read();
	int pos = 0;
	for(int i = 1 ; i <= N ; ++i){
		while(pos < M && y[pos + 1] < x[i]) ++pos;
		if(pos && pos < M){
			dist.push_back(PII(y[pos + 1] - x[i] , x[i] - y[pos]));
			lsh.push_back(x[i] - y[pos]);
		}
	}
	sort(lsh.begin() , lsh.end()); lsh.resize(unique(lsh.begin() , lsh.end()) - lsh.begin());
	for(auto &t : dist) t.second = lower_bound(lsh.begin() , lsh.end() , t.second) - lsh.begin() + 1;
	sort(dist.begin() , dist.end() , [&](PII x , PII y){return x.first < y.first || x.first == y.first && x.second > y.second;});
	dist.resize(unique(dist.begin() , dist.end()) - dist.begin());

	BIT::add(1 , 1); for(auto t : dist) BIT::add(t.second + 1 , BIT::qry(t.second));
	cout << BIT::qry(N + 1) << endl; return 0;
}