#include <bits/stdc++.h>
#define all(vec) vec.begin(), vec.end()
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
constexpr ll INF = (1LL << 30) - 1LL;
constexpr ll LINF = (1LL << 60) - 1LL;
constexpr double eps = 1e-9;
constexpr ll MOD = 1000000007LL;
template <typename T>
bool chmin(T& a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
};
template <typename T>
bool chmax(T& a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
};
template <typename T>
ostream& operator<<(ostream& os, vector<T> v) {
    for(int i = 0; i < v.size(); i++) {
        os << v[i].val << (i + 1 == v.size() ? "\n" : " ");
    }
    return os;
}
template <typename T>
vector<T> make_v(size_t a) {
    return vector<T>(a);
}
template <typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
    return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template <typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type fill_v(T& t, const V& v) {
    t = v;
}
template <typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type fill_v(T& t, const V& v) {
    for(auto& e : t) {
        fill_v(e, v);
    }
};
template <ll mod>
struct modint {
    ll val;
    inline ll extgcd(ll a, ll b, ll& x, ll& y) {
        if(a < b) {
            return extgcd(b, a, y, x);
        }
        if(b == 0) {
            x = 1, y = 0;
            return a;
        }
        ll d = extgcd(b, a % b, y, x);
        y -= a / b * x;
        return d;
    }
    inline ll minv(ll k) {
        ll x = 0, y = 0;
        extgcd(k, mod, x, y);
        if(x < 0) {
            x += mod;
        } else if(x == mod) {
            x = 0;
        }
        return x;
    }
    inline ll mpow(ll n) {
        ll res = 1, x = val;
        while(n > 0) {
            if(n & 1) {
                res *= x;
                res %= mod;
            }
            x = x * x % mod;
            n >>= 1;
        }
        return res;
    }
    constexpr modint() : val(0) {}
    constexpr modint(ll x) { val = (x + mod) % mod; }
    modint inv() { return modint(minv(val)); }
    modint operator+(const modint& to) const { return modint(val + to.val); }
    modint operator-(const modint& to) const { return modint(val - to.val); }
    modint operator*(const modint& to) const { return modint(val * to.val); }
    modint operator/(const modint& to) const {
        return modint(val * minv(to.val));
    }
    template <class T>
    explicit operator T() {
        return T(val);
    }
    template <typename T>
    modint operator+(const T& to) const {
        return modint(val + to);
    }
    template <typename T>
    modint operator-(const T& to) const {
        return modint(val - to);
    }
    template <typename T>
    modint operator*(const T& to) const {
        return modint(val * to);
    }
    template <typename T>
    modint operator/(const T& to) const {
        return modint(val * minv(to));
    }
    modint& operator++() { return *this = modint(val + 1); }
    modint& operator--() { return *this = modint(val - 1); }
    template <typename T>
    modint& operator+=(const T& to) {
        return *this = *this + to;
    }
    template <typename T>
    modint& operator-=(const T& to) {
        return *this = *this - to;
    }
    template <typename T>
    modint& operator*=(const T& to) {
        return *this = *this * to;
    }
    template <typename T>
    modint& operator/=(const T& to) {
        return *this = *this / to;
    }
    bool operator==(const modint& to) const { return val == to.val; }
    bool operator!=(const modint& to) const { return val != to.val; }
    bool operator>(const modint& to) const { return val > to.val; }
    bool operator>=(const modint& to) const { return val >= to.val; }
    bool operator<(const modint& to) const { return val < to.val; }
    bool operator<=(const modint& to) const { return val <= to.val; }
};
using mint = modint<MOD>;
vector<mint> f, fi;
void comb(int n) {
    f.resize(n + 10);
    fi.resize(n + 10);
    f[0] = 1;
    for(ll i = 1; i <= n; i++) {
        f[i] = f[i - 1] * i;
    }
    fi[n] = f[n].inv();
    for(ll i = n - 1; i >= 0; i--) {
        fi[i] = fi[i + 1] * (i + 1LL);
    }
}
mint ncr(ll n, ll r) {
    if(n < r || n < 0 || r < 0) {
        return 0;
    }
    return f[n] * fi[r] * fi[n - r];
}
inline mint mpow(mint x, ll n) {
    mint res = 1;
    while(n > 0) {
        if(n & 1) {
            res *= x;
        }
        x = x * x;
        n >>= 1;
    }
    return res;
}
template <typename T>
struct BinaryIndexedTree {
    vector<T> dat;
    size_t n;
    int h;
    BinaryIndexedTree(size_t n) : n(n) {
        h = 1;
        while(h <= n) {
            h <<= 1;
        }
        h >>= 1;
        dat.assign(++n, 0);
    }
    void add(int k, T x) {
        for(++k; k < n; k += k & -k) {
            dat[k] += x;
        }
    }
    T sum(int k) {
        T res = 0;
        for(++k; k > 0; k -= k & -k) {
            res += dat[k];
        }
        return res;
    }
};
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    vector<ll> x(n), y(m), vs;
    vector<P> v;
    for(int i = 0; i < n; i++) {
        cin >> x[i];
    }
    for(int i = 0; i < m; i++) {
        cin >> y[i];
    }
    for(int i = 0; i < n; i++) {
        int l = lower_bound(all(y), x[i]) - y.begin();
        int r = l;
        --l;
        if(l == -1 || r == m) {
            continue;
        }
        v.push_back(P(x[i] - y[l], y[r] - x[i]));
        vs.push_back(y[r] - x[i]);
    }
    if(v.size() == 0) {
        cout << 1 << endl;
        return 0;
    }
    vs.push_back(0);
    sort(all(vs));
    vs.erase(unique(all(vs)), vs.end());
    map<int, int> mp;
    for(int i = 0; i < vs.size(); i++) {
        mp[vs[i]] = i;
    }
    int nn = v.size(), nm = vs.size();
    sort(all(v));
    vector<int> a(nn);
    for(int i = 0; i < nn; i++) {
        a[i] = mp[v[i].second];
    }
    BinaryIndexedTree<mint> bit(nm + 1);
    bit.add(0, 1);
    bit.add(a[0], 1);
    for(int i = 1; i < nn; i++) {
        mint sum;
        if(v[i].first != v[i - 1].first) {
            sum = bit.sum(a[i] - 1);
        } else {
            sum = bit.sum(a[i] - 1) - bit.sum(a[i - 1] - 1);
        }
        bit.add(a[i], sum);
    }
    cout << bit.sum(nm - 1).val << endl;
}


Measured memory_bytes: 9200