#include <bits/stdc++.h>
using namespace std;
#define N 500010
#define mo 1000000007
#define ll long long
ll i,j,k,ans,m,n,x,y,t[N],a[N],b[N],c[N],cnt,f[N];
inline ll ask(ll x) {
    ll ans = 0;
    for (; x; x -= x & -x)(ans += t[x]) %= mo;
    return ans;
}
inline void add(ll x,ll d) {
    for (; x <= cnt; x += x & -x)(t[x] += d) %= mo;
}
struct dist {
    ll x, y;

    inline bool operator<(const dist &b) const {
        if (x == b.x)return y > b.y;
        return x < b.x;
    }

    inline bool operator==(const dist &b) const {
        return x == b.x && y == b.y;
    }
}e[N];
int main() {
    cin >> n >> m;
    for (i = 1; i <= n; ++i)cin >> a[i];
    for (i = 1; i <= m; ++i)cin >> b[i];
    for (i = j = 1; i < m && j <= n; ++i) {
        for (; j <= n && a[j] <= b[i]; ++j);
        if (j > n)break;
        for (; j <= n && a[j] < b[i + 1]; ++j)c[++*c] = a[j] - b[i], e[++cnt] = (dist) {b[i + 1] - a[j], c[*c]};
    }
    sort(c + 1, c + *c + 1);
    for (i = 1; i <= cnt; ++i)e[i].y = lower_bound(c + 1, c + *c + 1, e[i].y) - c;
    sort(e + 1, e + cnt + 1);
    for (ans = i = 1; i <= cnt; ++i) {
        if (e[i] == e[i - 1])continue;
        f[i] = (ask(e[i].y - 1) + 1) % mo;
        (ans += f[i]) %= mo, add(e[i].y, f[i]);
    }
    cout << ans;
}