#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=200005,p=1000000007;
int read(){
	int f=1,g=0;
	char ch=getchar();
	for (;!isdigit(ch);ch=getchar()) if (ch=='-') f=-1;
	for (;isdigit(ch);ch=getchar()) g=g*10+ch-'0';
	return f*g;
}
int qpow(int x,int k){
	int t=1;
	for (;k;k>>=1){
		if (k&1) t=(ll)t*x%p;
		x=(ll)x*x%p;
	}
	return t;
}
int n,m,cnt,a[N],pos[N],ans;
struct node{int x,y;}b[N];
bool cmp2(int x,int y){return a[x]<a[y];}
bool cmp(node a,node b){return (a.x!=b.x) ? (a.x<b.x) : (a.y>b.y);}
void check(int &x,int y){if ((x+=y)>=p) x-=p;}
struct BIT{
	int f[N];
	inline int lowbit(int x){return x&(-x);}
	void add(int x,int t){for (;x<=n;x+=lowbit(x)) check(f[x],t);}
	int query(int x){
		int t=1;
		for (;x;x-=lowbit(x)) check(t,f[x]);
		return t;
	}
}f;
int main(){
	n=read();m=read();
	for (int i=1;i<=n+m;i++) a[i]=read(),pos[i]=i;
	sort(pos+1,pos+n+m+1,cmp2);
	int las=0;
	for (int i=1;i<=n+m;i++){
		int x=pos[i];
		if (x>n) las=x;
		else b[x].x=(las) ? a[x]-a[las] : 0;
	}
	las=0;
	for (int i=n+m;i;i--){
		int x=pos[i];
		if (x>n) las=x;
		else b[x].y=(las) ? a[las]-a[x] : 0;
	}
	cnt=0;
	for (int i=1;i<=n;i++)
	if (b[i].x&&b[i].y) {b[++cnt]=b[i];a[cnt]=b[i].y;}
	sort(b+1,b+cnt+1,cmp);
	sort(a+1,a+cnt+1);
	ans=1;
	for (int i=1;i<=cnt;i++)
	if (cmp(b[i-1],b[i])){
		int x=lower_bound(a+1,a+cnt+1,b[i].y)-a;
		int t=f.query(x-1);f.add(x,t);
		check(ans,t);
	}
	printf("%d\n",ans);
	return 0;
}