#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e5+10,mo=1e9+7;
int a[N],b[N],n,m,t;
set<int> s;
vector<pair<int,int> > d;
ll tr[N];
map<int,int> p,q;
#define low(x) (x&(-x))
void add(int x,ll v){
	for (;x<=2*n;x+=low(x))(tr[x]+=v)%=mo;
}
ll query(int x){
	ll ans=0;
	for (;x;x-=low(x))(ans+=tr[x])%=mo;
	return ans;
}
map<pair<int,int>,int> p1;
int main(){
	cin>>n>>m;
	for (int i=1;i<=n;i++)scanf("%d",&a[i]);
	for (int i=1;i<=m;i++)scanf("%d",&b[i]),s.insert(b[i]);
	for (int i=1;i<=n;i++)
		if (*s.begin()<=a[i]&&a[i]<=*s.rbegin()){
			d.push_back(make_pair(a[i]-*--s.upper_bound(a[i]),*s.lower_bound(a[i])-a[i]));
		}
	for (auto i:d)
		p[i.first]=p[i.second]=1;
	for (auto i:p)q[i.first]=++t;
	for (int i=0;i<d.size();i++){
		d[i].first=q[d[i].first],d[i].second=-q[d[i].second];
		if (p1[d[i]])d[i].first=-1;
		else p1[d[i]]=1;
	}
	sort(d.begin(),d.end());
	ll ans=1;
	for (auto i:d){
		if (i.first<0)continue;
		ll sum=query(-i.second-1)+1;
		add(-i.second,sum);
		ans=(ans+sum)%mo;
	}
	cout<<ans<<endl;
}
