#include<bits/stdc++.h>

using namespace std;

#define ll  long long
#define ld  double

#define sz(x)   (int)x.size()
#define all(x)  x.begin(),x.end()

#define pb  emplace_back
#define X   first
#define Y   second

const int   N   = 2e5 + 5;
const int   mod = 1e9 + 7;

void add(int &a,int b)  {
    a += b;
    if (a >= mod)
        a -= mod;
}

typedef pair<int,int>   ii;

int t[N];

int upd(int p,int v)    {
    for(; p < N ; p += p & -p)
        add(t[p],v);
    return  1;
}
int get(int p)  {
    int ans = 0;
    for(; p > 0 ; p -= p & -p)
        add(ans,t[p]);

    return  ans;
}

int x[N];
int y[N];

int main()  {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

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

    for(int i = 0 ; i < n ; ++i)    cin >> x[i];
    for(int j = 0 ; j < m ; ++j)    cin >> y[j];

    vector<ii>  vec;
    vector<int> val;

    for(int i = 0 ; i < n ; ++i)    {
        int j = lower_bound(y,y + m,x[i]) - y;

        if (j == 0) continue;
        if (j == m) continue;

        vec.pb(x[i] - y[j - 1],y[j] - x[i]);
        val.pb(y[j] - x[i]);
    }
    sort(all(val)); val.erase(unique(all(val)),val.end());
    sort(all(vec),[&](ii  a,ii  b)  {
        if (a.X != b.X) return  a.X < b.X;
        if (a.X == b.X) return  a.Y > b.Y;
    });

    vec.erase(unique(all(vec)),vec.end());
    upd(1,1);

    for(ii  T : vec)    {
        int i = upper_bound(all(val),T.Y) - val.begin();
        upd(i + 1,get(i));
    }
    cout << get(sz(val) + 1) << endl;
}