#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned int ui; const ll mod = 1000000007; typedef long double ld; const ld INF = (ld)10000000000000; typedef pair P; #define stop char nyaa;cin>>nyaa; #define rep(i,n) for(int i=0;i=0;i--) #define Rep(i,sta,n) for(int i=sta;i=1;i--) #define Rep1(i,sta,n) for(int i=sta;i<=n;i++) typedef complex Point; const ld eps = 1e-8; const ld pi = acos(-1.0); typedef pair LDP; typedef pair LP; ll mod_inverse(ll a) { ll n = mod - 2; ll res = 1; while (n) { if (n & 1)res = res * a%mod; a = a * a%mod; n >>= 1; } return res; } const int N_MAX = 1000001; ll p[N_MAX], invp[N_MAX]; void init() { p[0] = 1; rep1(i, N_MAX - 1) { p[i] = p[i - 1] * i%mod; } invp[N_MAX - 1] = mod_inverse(p[N_MAX - 1]); per(i, N_MAX - 1) { invp[i] = invp[i + 1] * (i + 1) % mod; } } //xCyを求める ll comb(ll x, ll y) { if (x < y || y<0)return 0; ll res = p[x]; (res *= invp[y]) %= mod; (res *= invp[x - y]) %= mod; return res; } //xPyを求める ll comb2(ll x, ll y) { return p[x] * invp[x - y] % mod; } int main() { init(); ll n, m; cin >> n >> m; ll d1, d2; cin >> d1 >> d2; //左端を消し、a1