// Slower C++ solution:
// In the name of God



#include<bits/stdc++.h>



#define F first

#define S second

#define PB push_back

#define sz(s) int((s).size())

#define bit(n,k) (((n)>>(k))&1)



using namespace std;



typedef long long ll;

typedef pair<int,int> pii;

typedef pair<ll,ll> pll;



const int maxn=1e5+10,mod=1e9+7;

const ll inf=1e18;



int a[maxn],b[maxn],dp[maxn],sm[maxn],tot;

map<int,vector<pii> >mp;

vector<int>v;

set<pii>s;



void add(int id,int num){

    tot=(tot+num)%mod;

    while(id<maxn){

	sm[id]=(sm[id]+num)%mod;

	id+=(id & -id);

    }

}

int ask(int id){

    int ans=0;

    while(id>0){

	ans=(ans+sm[id])%mod;

	id-=(id & -id);

    }

    return ans;

}



int main(){

    int n,m;cin>>n>>m;

    for(int i=0;i<n;i++)

	cin>>a[i];

    for(int i=0;i<m;i++)

	cin>>b[i];

    for(int i=0;i<n;i++){

	if(a[i]<b[0] || b[m-1]<a[i])continue;

	int id=upper_bound(b,b+m,a[i])-b;

	int A=a[i]-b[id-1],B=b[id]-a[i];

	if(s.count({A,B})) continue;

	s.insert({A,B});

	mp[A].PB({B,i});

	v.PB(B);

    }

    mp[-1].PB({-1,n});

    v.PB(-1);

    sort(v.begin(),v.end());

    v.resize(unique(v.begin(),v.end())-v.begin());

    tot=1;

    for(auto it=mp.rbegin();it!=mp.rend();it++){

	vector<pii>&vec=it->S;

	for(pii p:vec){

	    p.F=lower_bound(v.begin(),v.end(),p.F)-v.begin()+1;

	    dp[p.S]=(tot-ask(p.F))%mod;

	}

	for(pii p:vec){

	    p.F=lower_bound(v.begin(),v.end(),p.F)-v.begin()+1;

	    add(p.F,dp[p.S]);

	}

    }

    if(dp[n]<0) dp[n]+=mod;

    cout<<dp[n]<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.032751292982718x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<cstdlib>

#include<ctime>

#include<utility>

#include<functional>

#include<cmath>

#include<vector>

//using namespace std;

using std::min;

using std::max;

using std::swap;

using std::sort;

using std::reverse;

using std::random_shuffle;

using std::lower_bound;

using std::upper_bound;

using std::unique;

using std::vector;

typedef long long ll;

typedef unsigned long long ull;

typedef double db;

typedef std::pair<int,int> pii;

typedef std::pair<ll,ll> pll;

void open(const char *s){

#ifndef ONLINE_JUDGE

    char str[100];sprintf(str,"%s.in",s);freopen(str,"r",stdin);sprintf(str,"%s.out",s);freopen(str,"w",stdout);

#endif

}

int rd(){int s=0,c,b=0;while(((c=getchar())<'0'||c>'9')&&c!='-');if(c=='-'){c=getchar();b=1;}do{s=s*10+c-'0';}while((c=getchar())>='0'&&c<='9');return b?-s:s;}

void put(int x){if(!x){putchar('0');return;}static int c[20];int t=0;while(x){c[++t]=x%10;x/=10;}while(t)putchar(c[t--]+'0');}

int upmin(int &a,int b){if(b<a){a=b;return 1;}return 0;}

int upmax(int &a,int b){if(b>a){a=b;return 1;}return 0;}

const ll p=1000000007;

const int N=100010;

int cmp(pii a,pii b)

{

    if(a.first!=b.first)

        return a.first<b.first;

    return a.second>b.second;

}

int n,m,t,t2;

int a[N],b[N],d[N];

pii c[N];

ll e[N];

ll add(ll a,ll b)

{

    a+=b;

    return a>=p?a-p:a;

}

void add(int x,ll v)

{

    for(;x<=t2;x+=x&-x)

        e[x]=add(e[x],v);

}

ll sum(int x)

{

    ll s=0;

    for(;x;x-=x&-x)

        s=add(s,e[x]);

    return s;

}

int main()

{

    //freopen("1.txt","r",stdin);

    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]);

    for(int i=1;i<=n;i++)

        if(a[i]>b[1]&&a[i]<b[m])

        {

            int x=lower_bound(b+1,b+m+1,a[i])-b;	//lower_bound 是第一个大于等于 a[i]的数，upper_bound是大于 

            if(b[x]==a[i])

                continue;

            c[++t]=pii(a[i]-b[x-1],b[x]-a[i]);		//坐标系上的点 

            d[++t2]=b[x]-a[i];						//点的纵坐标 

        }

    sort(d+1,d+t2+1);

    t2=unique(d+1,d+t2+1)-d-1;	//unique的作用是“去掉”容器中相邻元素的重复元素（不一定要求数组有序），它会把重复的元素添加到容器末尾（所以数组大小并没有改变），而返回值是去重之后的尾地址 

    							//由于返回的是容器末尾，所以如果想得到去重后的size，需要减去初始地址

	for(int i=1;i<=t;i++)

        c[i].second=lower_bound(d+1,d+t2+1,c[i].second)-d;

    sort(c+1,c+t+1,cmp);

    t=unique(c+1,c+t+1)-c-1;

    ll ans=1;

    for(int i=1;i<=t;i++)

    {

        ll s=sum(c[i].second-1)+1;

        ans+=s;

        add(c[i].second,s);

    }

    ans%=p;

    printf("%lld\n",ans);

    return 0;

}