const int N = 405949; // 405949 is my favorite number, but it's less than 5e5
const int LG = 20;
const int MOD = 1e9 + 7;
const int INF = 1e9;

#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <cmath>
#include <time.h>
#include <unordered_set>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<ll> vi;

#define forn(i, n) for (int (i) = 0; (i) != (n); (i)++)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define fi first
#define se second
#define re return
#define uniq(x) sort(all(x)); x.resize(unique(all(x)) - (x).begin());

#ifdef LOCAL
#define dbg(x) cerr << __LINE__ << " " << #x << " " << x << endl
#define ln cerr << __LINE__ << endl
#else
#define dbg(x) void(0)
#define ln void(0)
#endif // LOCAL

ll inq(ll x, ll y)
{
    if (!y) re 1 % MOD;
    ll l = inq(x, y / 2);
    if (y % 2) re l * l % MOD * x % MOD;
    re l * l % MOD;
}

ll inv(ll x)
{
    return inq(x, MOD - 2);
}

bool __precomputed_combinatorics = 0;
vector<ll> __fact, __ufact, __rev;

void __precompute_combinatorics()
{
    __precomputed_combinatorics = 1;
    __fact.resize(N);
    __ufact.resize(N);
    __rev.resize(N);
    __rev[1] = 1;
    for (int i = 2; i < N; i++) __rev[i] = MOD - __rev[MOD % i] * (MOD / i) % MOD;
    __fact[0] = 1, __ufact[0] = 1;
    for (int i = 1; i < N; i++) __fact[i] = __fact[i - 1] * i % MOD, __ufact[i] = __ufact[i - 1] * __rev[i] % MOD;
}

ll fact(int x)
{
    if (!__precomputed_combinatorics) __precompute_combinatorics();
    return __fact[x];
}

ll cnk(int n, int k)
{
    if (!__precomputed_combinatorics) __precompute_combinatorics();
    return __fact[n] * __ufact[n - k] % MOD * __ufact[k] % MOD;
}

int n, m;
int a[N], b[N], x[N], y[N];
pair<int, int> p[N];

bool comp(pii a, pii b)
{
    if (a.fi == b.fi) return a.se > b.se;
    return a.fi < b.fi;
}

ll Tree[4 * N];

ll Get(int l, int r, int L = 0, int R = N, int V = 0)
{
    if (r <= L || R <= l) return 0;
    if (l <= L && R <= r) return Tree[V];
    int M = (L + R) / 2;
    return (Get(l, r, L, M, 2 * V + 1) + Get(l, r, M, R, 2 * V + 2)) % MOD;
}

void Add(int p, int val, int L = 0, int R = N, int V = 0)
{
    if (L + 1 == R)
    {
        Tree[V] = (Tree[V] + val) % MOD;
        return;
    }
    int M = (L + R) / 2;
    if (p < M) Add(p, val, L, M, 2 * V + 1);
    else Add(p, val, M, R, 2 * V + 2);
    Tree[V] = (Tree[2 * V + 1] + Tree[2 * V + 2]) % MOD;
}

signed main()
{
    #ifdef ONLINE_JUDGE
        ios_base::sync_with_stdio(false);
        cin.tie(0);
        cout.tie(0);
    #endif // ONLINE_JUDGE
    cin >> n >> m;
    forn(i, n) cin >> a[i];
    forn(j, m) cin >> b[j];
    int po = 0;
    for (int i = 0; i < n; i++)
    {
        if (b[0] < a[i] && a[i] < b[m - 1])
        {
            x[po] = a[i];
            po++;
        }
    }
    n = po;
    for (int i = 0; i < m; i++) y[i] = b[i];
    fill(a, a + N, 0);
    fill(b, b + N, 0);
    int c = 0;
    for (int i = 0; i < n; i++)
    {
        while (!(y[c] < x[i] && x[i] < y[c + 1])) c++;
        a[i] = x[i] - y[c];
        b[i] = y[c + 1] - x[i];
    }
    vi as = {0}, bs = {0};
    for (int i = 0; i < n; i++) as.push_back(a[i]);
    for (int i = 0; i < n; i++) bs.push_back(b[i]);
    uniq(as);
    uniq(bs);
    map<int, int> ca, cb;
    for (int i = 0; i < as.size(); i++) ca[as[i]] = i;
    for (int i = 0; i < bs.size(); i++) cb[bs[i]] = i;
    for (int i = 0; i < n; i++)
    {
        p[i] = {ca[a[i]], cb[b[i]]};
    }
    sort(p, p + n, comp);
    Add(0, 1);
    for (int i = 0; i < n; i++)
    {
        if (i && p[i].fi == p[i - 1].fi && p[i].se == p[i - 1].se) continue;
        #ifdef LOCAL
            cout << p[i].fi << " " << p[i].se << "\n";
            cout << Get(0, p[i].second) << "\n";
        #endif // LOCAL
        Add(p[i].second, Get(0, p[i].second));
    }
    cout << Get(0, N);
}

/* Note:
Check constants at the beginning of the code.
Check corner cases.
*/


Measured memory_bytes: 25588