#include <bits/stdc++.h>
using namespace std;

#define int long long
typedef vector<int> vint;
typedef pair<int, int> pint;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
template<typename T, typename U> inline bool chmax(T &a, const U &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template<typename T, typename U> inline bool chmin(T &a, const U &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}
struct Init {
    Init() {
        cout << fixed << setprecision(20);
    };
} init;

template<int mod>
struct ModInt {
    int x;

    ModInt() : x(0) {}

    ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}

    ModInt &operator+=(const ModInt &p) {
        if ((x += p.x) >= mod) { x -= mod; }
        return *this;
    }

    ModInt &operator-=(const ModInt &p) {
        if ((x += mod - p.x) >= mod) { x -= mod; }
        return *this;
    }

    ModInt &operator*=(const ModInt &p) {
        x = (int) (1LL * x * p.x % mod);
        return *this;
    }

    ModInt &operator/=(const ModInt &p) {
        *this *= p.inverse();
        return *this;
    }

    ModInt operator-() const { return ModInt(-x); }

    ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }

    ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }

    ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }

    ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }

    bool operator==(const ModInt &p) const { return x == p.x; }

    bool operator!=(const ModInt &p) const { return x != p.x; }

    ModInt inverse() const {
        int a = x, b = mod, u = 1, v = 0, t;
        while (b > 0) {
            t = a / b;
            swap(a -= t * b, b);
            swap(u -= t * v, v);
        }
        return ModInt(u);
    }

    ModInt pow(int64_t n) const {
        ModInt ret(1), mul(x);
        while (n > 0) {
            if (n & 1) { ret *= mul; }
            mul *= mul;
            n >>= 1;
        }
        return ret;
    }

    friend ostream &operator<<(ostream &os, const ModInt &p) {
        return os << p.x;
    }

    friend istream &operator>>(istream &is, ModInt &a) {
        int64_t t;
        is >> t;
        a = ModInt<mod>(t);
        return (is);
    }

    static int get_mod() { return mod; }
};

const int mod = 1e9 + 7;
using mint=ModInt<mod>;

// FenwickTree (0 - indexed)
// T: 可換モノイド
template<typename T>
class FenwickTree {
    const int n;
    std::vector<T> data;
public:
    // 要素数を指定し、全要素加法単位元で初期化
    FenwickTree(int n) : n(n), data(n + 1, T()) {}

    // 元となるstd::vectorを用意して初期化
    FenwickTree(std::vector<T> source) : n(source.size()), data(n + 1) {
        std::copy(source.begin(), source.end(), data.begin() + 1);
        for (int i = 1; i < n; i++) { data[i + (i & -i)] += data[i]; }
    }

    // [0, i)の区間和を取得
    T getSum(int i) const {
        T ret = T();
        for (i; i > 0; i -= i & -i) { ret += data[i]; }
        return ret;
    }

    // 要素iにxを加算
    void add(int i, T x) { for (i++; i <= n; i += i & -i) { data[i] += x; }}

    // 以下、T: 可換群

    // [l, r)の区間和を取得
    T getSum(int l, int r) const {
        return getSum(r) - getSum(l);
    }

    // [0, i)の区間和がx以上となる最小のiを取得 (区間和の単調性が必要)
    int getLowerBound(T x) const {
        if (x <= T()) { return 0; }
        int i = 0, r = 1;
        while (r < n) { r <<= 1; }
        for (int k = r; k > 0; k >>= 1) {
            if (i + k <= n && data[i + k] < x) {
                x -= data[i + k];
                i += k;
            }
        }
        return i + 1;
    }
};

int N, M;
int x[110000], y[110000];
vint a;
map<int, int> zat;
vector<pint> ab;
signed main() {
    cin >> N >> M;
    for (int i = 0; i < N; i++) { cin >> x[i]; }
    for (int i = 1; i <= M; i++) { cin >> y[i]; }
    y[0] = -1e18, y[M + 1] = 1e18;
    int c = 0;
    for (int i = 0; i < N; i++) {
        while (y[c + 1] < x[i]) { c++; }
        if (c == 0 || c == M) { continue; }
        a.push_back(x[i] - y[c]);
        ab.push_back(pint(x[i] - y[c], y[c + 1] - x[i]));
    }
    sort(a.begin(), a.end());
    a.erase(unique(a.begin(), a.end()), a.end());
    for (int i = 0; i < a.size(); i++) { zat[a[i]] = i + 1; }
    sort(ab.begin(), ab.end());
    reverse(ab.begin(), ab.end());
    stable_sort(ab.begin(), ab.end(), [](const pint &l, const pint &r) { return l.second < r.second; });
    ab.erase(unique(ab.begin(), ab.end()), ab.end());
    mint ans = 1;
    FenwickTree<mint> ft(a.size() + 1);
    ft.add(0, 1);
    for (int i = 0; i < ab.size(); i++) {
        mint cur = ft.getSum(zat[ab[i].first]);
        ft.add(zat[ab[i].first], cur);
        ans += cur;
    }
    cout << ans << endl;

}

Measured memory_bytes: 11112