#include<cstdio>
#include<cstring>
#include<algorithm>
#include<set>
using namespace std;
const int N=100005,mod=1000000007;
int n,m,k,ans=1,pos[N],a[N],b[N],c[N],x[N],y[N],h[N],f[N];
set<int> s;
bool cmp(int a,int b){
	return x[a]==x[b]?y[a]>y[b]:x[a]<x[b];
}
bool comp(int a,int b){
	return x[a]==x[b]&&y[a]==y[b];
}
void add(int i,int v){
	while(i<=h[0]){
		c[i]=(c[i]+v)%mod;
		i+=i&(-i);
	}
}
int sum(int i){
	int res=0;
	while(i){
		res=(res+c[i])%mod;
		i-=i&(-i);
	}
	return res;
}
int main(){
	scanf("%d%d",&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]);
	}
	set<int>::iterator it;
	for(int i=1;i<=n;i++){
		if(a[i]>b[1]&&a[i]<b[m]&&!s.count(a[i])){
			it=s.upper_bound(a[i]);
			k++;
			pos[k]=k;
			y[k]=*it-a[i];
			it--;
			x[k]=a[i]-*it;
			h[++h[0]]=y[k];
		}
	}
	sort(pos+1,pos+k+1,cmp);
	k=unique(pos+1,pos+k+1,comp)-pos-1;
	sort(h+1,h+h[0]+1);
	h[0]=unique(h+1,h+h[0]+1)-h-1;
	for(int i,j=1;j<=k;j++){
		i=pos[j];
		y[i]=lower_bound(h+1,h+h[0]+1,y[i])-h;
		f[i]=(sum(y[i]-1)+1)%mod;
		ans=(ans+f[i])%mod;
		add(y[i],f[i]);
	}
	printf("%d\n",ans);
	return 0;
}