#include<cstdio>
#include<algorithm>
#define fo(x,a,b) for(int x=(a),e_=(b);x<=e_;x++)
#define mo 1000000007
#define plus(a,b) (a+=b)%=mo
#define fi first
#define se second
#define ww printf

using namespace std;
const int N=100005;
pair<int,int> q[N];
int pos[N],X[N],a[N],tp[N],n,m,tot=0;

void add(int x,int d){
	for(; x<=tot; x+=(x&(-x))) plus(a[x],d);
}
int qry(int x){
	int ans=a[0];
	for(; x; x-=(x&(-x))) plus(ans,a[x]);
	return ans;
}
int main(){
	int k1,k2;
	scanf("%d %d",&n,&m);
	fo(i,1,n) scanf("%d",&X[i]);
	fo(i,1,m) scanf("%d",&pos[i]);

	fo(i,1,n) {
		if(X[i]<pos[1] || X[i]>pos[m]) continue;
		k2=upper_bound(pos+1,pos+1+m,X[i]) - pos; k1=k2-1;
		if(k1<1 || k2>m) continue;
		
		q[++tot]=make_pair(X[i]-pos[k1],pos[k2]-X[i]);
	}
	fo(i,1,tot) tp[i]=q[i].fi;
	sort(tp+1,tp+1+tot);
	tp[0]=1;fo(i,2,tot) if(tp[i]!=tp[tp[0]]) tp[++tp[0]]=tp[i];
	fo(i,1,tot) q[i].fi=lower_bound(tp+1,tp+1+tp[0],q[i].fi)-tp;

	fo(i,1,tot) tp[i]=q[i].se;
	sort(tp+1,tp+1+tot);
	tp[0]=1;fo(i,2,tot) if(tp[i]!=tp[tp[0]]) tp[++tp[0]]=tp[i];
	fo(i,1,tot) q[i].se=lower_bound(tp+1,tp+1+tp[0],q[i].se)-tp;

	fo(i,1,tot) {
//		ww("now :%d %d\n",q[i].fi,q[i].se);
		q[i].se=-q[i].se;
	}sort(q+1,q+1+tot), a[0]=1;

	fo(i,1,tot) {
		if(i>1 && q[i]==q[i-1]) continue;
//		printf("%d %d\n",q[i].fi,-q[i].se);
		add(-q[i].se,qry(-q[i].se-1));
	}
	printf("%d",qry(tot));
	return 0;
}
