use proconio::input;

trait ModValue:
    std::ops::Add<Output = Self>
    + std::ops::Sub<Output = Self>
    + std::ops::Mul<Output = Self>
    + std::ops::Div<Output = Self>
    + std::ops::Rem<Output = Self>
    + std::ops::AddAssign
    + std::ops::SubAssign
    + std::ops::MulAssign
    + std::ops::DivAssign
    + std::ops::RemAssign
    + std::ops::Neg
    + std::cmp::Ord
    + Clone
    + Copy
    + std::fmt::Debug
    + Sized
{
    fn modulus() -> Self;
    fn zero() -> Self;
    fn one() -> Self;
}

#[derive(Clone, Copy, Debug)]
struct Modint<Value: ModValue>(Value);

impl<Value: ModValue> Modint<Value> {
    #[allow(dead_code)]
    pub fn with_value(x: Value) -> Self {
        Self(Self::normalize(x))
    }

    #[allow(dead_code)]
    pub fn with_value_unchecked(x: Value) -> Self {
        Self(x)
    }

    #[allow(dead_code)]
    pub fn validate(&self) -> &Self {
        assert!(Value::zero() <= self.0 && self.0 < Value::modulus());
        &self
    }

    fn normalize(x: Value) -> Value {
        let x = x % Value::modulus();
        if x < Value::zero() {
            x + Value::modulus()
        } else {
            x
        }
    }

    fn add_unchecked(x: Value, y: Value) -> Value {
        let z = x + y;
        if Value::modulus() <= z {
            z - Value::modulus()
        } else {
            z
        }
    }

    fn sub_unchecked(x: Value, y: Value) -> Value {
        let z = x - y;
        if x < Value::zero() {
            z + Value::modulus()
        } else {
            z
        }
    }

    fn neg_unchecked(x: Value) -> Value {
        if x == Value::zero() {
            Value::zero()
        } else {
            Value::modulus() - x
        }
    }

    fn mul_unchecked(x: Value, y: Value) -> Value {
        x * y % Value::modulus()
    }

    fn div_unchecked(x: Value, y: Value) -> Value {
        Self::mul_unchecked(x, Self::inv_unchecked(y))
    }

    fn inv_unchecked(mut x: Value) -> Value {
        let mut y: Value = Value::modulus();
        let mut u: Value = Value::one();
        let mut v: Value = Value::zero();
        while x != Value::zero() {
            let q = y / x;
            y -= x * q;
            v -= u * q;
            std::mem::swap(&mut x, &mut y);
            std::mem::swap(&mut u, &mut v);
        }
        if v < Value::zero() {
            v + Value::modulus()
        } else {
            v
        }
    }
}

macro_rules! impl_bop {
    (
        $(
            $bop_trait: ident::$bop_fn: ident, $bop_assign_trait: ident::$bop_assign_fn: ident, $impl: ident;
        )*
    ) => {
        $(
            impl<Value: ModValue> std::ops::$bop_trait for Modint<Value> {
                type Output = Self;
                fn $bop_fn(self, rhs: Self) -> Self::Output {
                    Modint(Self::$impl(self.0, rhs.0))
                }
            }
            impl<Value: ModValue> std::ops::$bop_assign_trait for Modint<Value> {
                fn $bop_assign_fn(&mut self, rhs: Self) {
                    use std::ops::$bop_trait;
                    *self = Modint::$bop_fn(*self, rhs)
                }
            }
        )*
    };
}

impl_bop! {
    Add::add, AddAssign::add_assign, add_unchecked;
    Sub::sub, SubAssign::sub_assign, sub_unchecked;
    Mul::mul, MulAssign::mul_assign, mul_unchecked;
    Div::div, DivAssign::div_assign, div_unchecked;
}

impl<Value: ModValue> std::ops::Neg for Modint<Value> {
    type Output = Self;
    fn neg(self) -> Self::Output {
        Modint(Self::neg_unchecked(self.0))
    }
}

impl<Value: ModValue> std::iter::Sum<Self> for Modint<Value> {
    fn sum<I: Iterator<Item = Self>>(iter: I) -> Self {
        iter.fold(Self::with_value(Value::zero()), std::ops::Add::add)
    }
}

impl<Value: ModValue + Default> std::default::Default for Modint<Value> {
    fn default() -> Self {
        Self::with_value(Default::default())
    }
}

impl<Value: ModValue> std::convert::From<Value> for Modint<Value> {
    fn from(x: Value) -> Self {
        Self::with_value(x)
    }
}

#[allow(unused_macros)]
macro_rules! modint {
    ($x: expr) => {
        Modint::with_value($x)
    };
}

#[allow(unused_macros)]
macro_rules! impl_modvalue {
    ($(const $mod_name: ident: $ty: ty = $mod_value: expr;)*) => {
        $(
            const $mod_name: $ty = $mod_value;
            impl ModValue for $ty {
                fn modulus() -> Self {
                    $mod_name
                }
                fn zero() -> Self {
                    0
                }
                fn one() -> Self {
                    1
                }
            }
        )*
    };
}

impl_modvalue! {
    const MOD: i64 = 1_000_000_007;
}

mod segtree {
    #[allow(dead_code)]
    pub(super) trait SegTrait {
        type Value: Clone;
        fn id() -> Self::Value;
        fn op(x: &Self::Value, y: &Self::Value) -> Self::Value;
    }

    #[allow(dead_code)]
    pub(super) struct Segtree<T: SegTrait> {
        table: Vec<T::Value>,
    }

    #[allow(dead_code)]
    impl<T: SegTrait> Segtree<T> {
        pub fn new(n: usize) -> Self {
            Self {
                table: vec![T::id(); 2 * n],
            }
        }

        pub fn size(&self) -> usize {
            self.table.len() / 2
        }

        pub fn map(&mut self, mut i: usize, f: impl Fn(&mut T::Value)) {
            let n = self.size();
            assert!(i < n);
            i += n;
            f(&mut self.table[i]);
            i /= 2;
            while 0 < i {
                let tmp = T::op(&self.table[2 * i], &self.table[2 * i + 1]);
                self.table[i] = tmp;
                i /= 2;
            }
        }

        pub fn add(&mut self, i: usize, x: T::Value)
        where
            T::Value: Copy + std::ops::AddAssign,
        {
            self.map(i, |y| *y += x);
        }

        pub fn fold(&self, mut l: usize, mut r: usize) -> T::Value {
            let n = self.size();
            assert!(l <= r && r <= n);
            l += n;
            r += n;
            let mut ans = T::id();
            while l < r {
                if l % 2 == 1 {
                    ans = T::op(&ans, &self.table[l]);
                    l += 1;
                }
                if r % 2 == 1 {
                    r -= 1;
                    ans = T::op(&ans, &self.table[r]);
                }
                l /= 2;
                r /= 2;
            }
            ans
        }

        pub fn fold_all(&self) -> T::Value {
            let n = self.size();
            self.fold(0, n)
        }

        pub fn collect(&self) -> Vec<T::Value> {
            let n = self.size();
            self.table[n..].into()
        }
    }

    pub(super) struct AddMonoid<T: std::ops::Add<Output = T>> {
        phantom: std::marker::PhantomData<T>,
    }
    impl<T: Clone + std::ops::Add<Output = T> + std::default::Default> SegTrait for AddMonoid<T> {
        type Value = T;

        fn id() -> Self::Value {
            T::default()
        }

        fn op(x: &T, y: &T) -> T {
            x.clone() + y.clone()
        }
    }
}

fn main() {
    input!(n: usize, m: usize, a: [i64; n], b: [i64; m]);
    let mut data = vec![];
    let mut j = 0;
    for i in 0..n {
        while j < m && b[j] < a[i] {
            j += 1;
        }
        if j == 0 {
            continue;
        }
        if j == m {
            break;
        }
        data.push((a[i] - b[j - 1], b[j] - a[i]));
    }

    let mut coord_x: Vec<_> = data.iter().map(|&(x, _)| x).collect();
    let mut coord_y: Vec<_> = data.iter().map(|&(_, y)| y).collect();
    coord_x.sort();
    coord_y.sort();
    coord_x.dedup();
    coord_y.dedup();

    data.sort_by_key(|&(x, y)| (x, std::cmp::Reverse(y)));
    data.dedup();
    let data: Vec<_> = data
        .iter()
        .map(|&(x, y)| {
            (
                coord_x.binary_search(&x).unwrap(),
                coord_y.binary_search(&y).unwrap(),
            )
        })
        .collect();

    let mut seg = segtree::Segtree::<segtree::AddMonoid<Modint<i64>>>::new(n + 1);
    seg.add(0, modint!(1));
    for &(_, i) in &data {
        let crr = seg.fold(0, i + 1);
        seg.add(i + 1, crr);
    }
    println!("{}", seg.fold_all().0);
}


Measured memory_bytes: 12032