#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <climits>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <string>
#include <list>
#include <bitset>
#include <vector>
using namespace std;

#define I64d_OJ

//#ifdef I64d_OJ
//#define LL __int64
//#endif // I64d_OJ
#ifdef I64d_OJ
#define LL long long
#endif // I64d_OJ

typedef unsigned LL ULL;
typedef unsigned uint;
typedef pair<int,int> pii;
typedef pair<double,double> pdd;
typedef pair<LL,LL> pLL;
typedef vector<int> vi;

inline int read(){
    int x=0,f=1;
    char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-') f=-f; ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0'; ch=getchar();}
    return x*f;
}

#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
#define ls rt<<1
#define rs rt<<1|1
#define MID(a,b) (((LL)(a)+(LL)(b))>>1)
#define absx(a) ((a)<0?-(a):(a))
#define MK(a,b) make_pair(a,b)
#define PB(a) push_back(a)
#define lowbit(x) ((x)&-(x))

#define lc c[x][0]
#define rc c[x][1]

template< typename T >
inline void Max(T &a,T &b){if(a<b) a=b;}
template< typename T>
inline void Min(T &a,T &b){if(a>b) a=b;}

const double pi=(double)acos(-1.0);
const double eps=(double)1e-8;
const int INF = (int) 0x3f3f3f3f;
const int MOD = (int) 1e9+7;
const int MAXN =(int) 2e5+10;
const int MAXM = (int) 3e6+10;

///--------------------START-------------------------
int M,N;
int xx[MAXN],yy[MAXN];
int yycnt;
int C[MAXN];
LL dp[MAXN];

void update(int x,LL d){
    while(x<MAXN){
        C[x]+=d;
        C[x]%=MOD;
        x+=lowbit(x);
    }
}

LL sum(int x){
    LL ret=0;
    while(x){
        ret+=C[x];
        x-=lowbit(x);
    }
    return ret%MOD;
}

struct Node{
    int x,y;
}node[MAXN];
int nodecnt;

bool cmp(const Node& a,const Node& b){
    if(a.x==b.x) return a.y<b.y;
    return a.x<b.x;
}

void work(){
    scanf("%d%d",&N,&M);
    for(int i=1;i<=N;i++){
        scanf("%d",&xx[i]);
    }
    for(int i=1;i<=M;i++){
        scanf("%d",&yy[i]);
    }
    for(int i=1;i<=N;i++){
        int p=lower_bound(yy+1,yy+1+M,xx[i])-yy;
        if(p<=1||p>M) continue;
        if(yy[p]==xx[i]) continue;
        ++nodecnt;
        node[nodecnt].x=xx[i]-yy[p-1];
        node[nodecnt].y=yy[p]-xx[i];
    }
//    printf("node:\n");
//    for(int i=1;i<=nodecnt;i++){
//        printf("%d %d\n",node[i].x,node[i].y);
//    }
//    printf("\n");
    sort(node+1,node+1+nodecnt,cmp);
    int tmpcnt=nodecnt;
    nodecnt=0;
    for(int i=1;i<=tmpcnt;i++){
        if(node[i].x!=node[i-1].x||node[i].y!=node[i-1].y){
            node[++nodecnt]=node[i];
        }
    }
//    printf("node:\n");
//    for(int i=1;i<=nodecnt;i++){
//        printf("%d %d\n",node[i].x,node[i].y);
//    }
//    printf("\n");
    yycnt=0;
    for(int i=1;i<=nodecnt;i++){
        yy[++yycnt]=node[i].y;
        yy[++yycnt]=node[i].y-1;
    }
    sort(yy+1,yy+1+yycnt);
    int tmpyycnt=yycnt;
    yycnt=1;
    for(int i=2;i<=tmpyycnt;i++){
        if(yy[i]!=yy[i-1]) yy[++yycnt]=yy[i];
    }
//    printf("yy:\n");
//    for(int i=1;i<=yycnt;i++) printf("%d ",yy[i]);
//    printf("\n");
    int posx=0;
    for(int i=1;i<=nodecnt;i++){
        int pos=lower_bound(yy+1,yy+1+yycnt,node[i].y-1)-yy;
//        printf("y = %d , pos = %d\n",node[i].y-1,pos);
        dp[i]=(1+sum(pos))%MOD;
        if(i<nodecnt&&node[i].x<node[i+1].x){
            while(posx<i){
                posx++;
                int posy=lower_bound(yy+1,yy+1+yycnt,node[posx].y)-yy;
//                printf("update %d %lld\n",posy,dp[posx]);
                update(posy,dp[posx]);
            }
        }
    }
    LL ans=1;
    for(int i=1;i<=nodecnt;i++){
        ans+=dp[i];
//        printf("%lld ",dp[i]);
    }
//    printf("\n");
    printf("%lld\n",ans%MOD);
}

///--------------------END-------------------------
int main(){
#ifdef NNever
//freopen("data.in","r",stdin);
///freopen("out.txt","w",stdout);
#endif // NNever
    work();
    return 0;
}





Measured memory_bytes: 4608