#include using namespace std; using ll = long long; const ll MOD = 1e9+7; ll dpV[101][100001],dpR[101][100001]; int main() { ll n,m; cin >> n >> m; vector V(n),R(m); for(ll i = 0;i> V[i]; for(ll i = 0;i> R[i]; ll A,B; cin >> A >> B; dpV[0][0]=dpR[0][0]=1; for(ll i = 0;i sum(100002); for(ll i = 0;i<100001;i++) { (sum[i+1] += sum[i]+dpR[m][i])%=MOD; //cout<