#include <cstdint>
#include <iterator>
#include <stdexcept>
#include <functional>
#include <cassert>
#include <initializer_list>
#include <string>
#include <algorithm>
#include <iostream>
#include <vector>
#include <utility>
#include <type_traits>
namespace loquat {
template <int MOD>
class modulus_integer {
public:
	typedef modulus_integer<MOD> self_type;
private:
	int m_value;
	static self_type unsafe_construct(int x) noexcept {
		self_type y;
		y.m_value = x;
		return y;
	}
public:
	modulus_integer() noexcept
		: m_value(0)
	{ }
	modulus_integer(int x) noexcept
		: m_value(x % MOD)
	{
		if(m_value < 0){ m_value += MOD; }
	}
	int operator*() const noexcept { return m_value; }
	self_type& operator=(const self_type& x) noexcept {
		m_value = x.m_value;
		return *this;
	}
	self_type operator+(const self_type& x) const noexcept {
		const int y = m_value + x.m_value;
		return unsafe_construct(y >= MOD ? y - MOD : y);
	}
};
template <int MOD>
inline std::ostream& operator<<(
	std::ostream& os, const modulus_integer<MOD>& x)
{
	os << *x;
	return os;
}
}
namespace loquat {
namespace bitmanip {
template <typename T>
inline auto clz(T x) noexcept ->
	typename std::enable_if<sizeof(int) < sizeof(T), unsigned int>::type
{
	return __builtin_clzll(x);
}
template <typename T>
inline T clp2(T x) noexcept {
	if(x == 0u){ return 0u; }
	return T(1u) << (sizeof(T) * 8u - clz(x - 1));
}
}
}
namespace loquat {
template <typename Impl>
class range_query_behavior_wrapper {
public:
	using value_type = typename Impl::value_type;
private:
	Impl m_impl;
public:
	range_query_behavior_wrapper(Impl impl) : m_impl(std::move(impl)) { }
	value_type identity() const {
		return m_impl.identity();
	}
	value_type merge(const value_type& a, const value_type& b) const {
		return m_impl.merge(a, b);
	}
};
}
namespace loquat {
template <typename Behavior>
class segment_tree {
public:
	using behavior_type = Behavior;
	using value_type = typename behavior_type::value_type;
private:
	size_t m_actual_size;
	std::vector<value_type> m_values;
	range_query_behavior_wrapper<behavior_type> m_behavior;
	void initialize(){
		const auto m = m_values.size() / 2;
		for(size_t i = 0; i < m; ++i){
			const auto k = m - 1 - i;
			m_values[k] = m_behavior.merge(
				m_values[k * 2 + 1], m_values[k * 2 + 2]);
		}
	}
public:
	segment_tree(
		size_t size,
		const behavior_type& behavior = behavior_type())
		: m_actual_size(size)
		, m_values(bitmanip::clp2(m_actual_size) * 2 - 1)
		, m_behavior(behavior)
	{
		const auto it = m_values.begin() + m_values.size() / 2;
		std::fill(it, it + m_actual_size, value_type());
		initialize();
	}
	void update(size_t i, const value_type& x){
		i += m_values.size() / 2;
		m_values[i] = x;
		while(i > 0){
			i = (i - 1) / 2;
			m_values[i] = m_behavior.merge(
				m_values[i * 2 + 1], m_values[i * 2 + 2]);
		}
	}
	value_type query(size_t left, size_t right) const {
		const auto m = m_values.size() / 2;
		left += m; right += m;
		value_type l_value = m_behavior.identity(), r_value = l_value;
		while(left < right){
			if((left & 1u) == 0u){
				const auto& x = m_values[left];
				l_value = m_behavior.merge(l_value, x);
			}
			if((right & 1u) == 0u){
				const auto& x = m_values[right - 1];
				r_value = m_behavior.merge(x, r_value);
			}
			left  = left / 2;
			right = (right - 1) / 2;
		}
		return m_behavior.merge(l_value, r_value);
	}
};
}
using namespace std;
static const int INF = 2000000010;
static const int MOD = 1000000007;
using mint = loquat::modulus_integer<MOD>;
using pii = pair<int, int>;
struct range_query_behavior {
	using value_type = mint;
	value_type identity() const { return 0; }
	value_type merge(const value_type& a, const value_type& b) const { return a + b; }
};
int main(){
	ios_base::sync_with_stdio(false);
	int n, m;
	cin >> n >> m;
	vector<int> x(n), y(m);
	for(int i = 0; i < n; ++i){ cin >> x[i]; }
	for(int i = 0; i < m; ++i){ cin >> y[i]; }
	vector<pii> dpair(n);
	for(int i = 0; i < n; ++i){
		const auto it = upper_bound(y.begin(), y.end(), x[i]);
		const int r = (it == y.end()) ? INF : (*it - x[i]);
		const int l = (it == y.begin()) ? INF : (x[i] - *(it - 1));
		dpair[i] = pii(l, r);
	}
	vector<int> lcomp({0, INF}), rcomp({0, INF});
	for(int i = 0; i < n; ++i){
		lcomp.push_back(dpair[i].first);
		rcomp.push_back(dpair[i].second);
	}
	sort(lcomp.begin(), lcomp.end());
	sort(rcomp.begin(), rcomp.end());
	lcomp.erase(unique(lcomp.begin(), lcomp.end()), lcomp.end());
	rcomp.erase(unique(rcomp.begin(), rcomp.end()), rcomp.end());
	const int lk = lcomp.size() - 1, rk = rcomp.size() - 1;
	for(int i = 0; i < n; ++i){
		dpair[i].first  = lower_bound(lcomp.begin(), lcomp.end(), dpair[i].first)  - lcomp.begin();
		dpair[i].second = lower_bound(rcomp.begin(), rcomp.end(), dpair[i].second) - rcomp.begin();
	}
	sort(dpair.begin(), dpair.end());
	dpair.erase(unique(dpair.begin(), dpair.end()), dpair.end());
	sort(
		dpair.begin(), dpair.end(),
		[](const pii& a, const pii& b){
			if(a.first == b.first){ return a.second > b.second; }
			return a.first < b.first;
		});
	loquat::segment_tree<range_query_behavior> st(rk);
	int min_nonzero = 0;
	st.update(0, 1);
	for(const auto p : dpair){
		const int l = p.first, r = p.second;
		if(r < rk){ st.update(r, st.query(0, r + 1)); }
		if(l >= lk){
			while(min_nonzero < r){
				st.update(min_nonzero, 0);
				min_nonzero++;
			}
		}
	}
	cout << st.query(0, rk) << endl;
	return 0;
}


Measured memory_bytes: 3572