#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()
{
    open("arc101f");
    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;
            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;
    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;
}