#include <iostream>
#include<bits/stdc++.h> 
using namespace std;
#define ll long long
const ll mod=10e9+7;
int main()
{
    ll a,b,c,d;
    cin>>a>>b>>c>>d;
    cout<<(((a*d)%mod)-((b*c)%mod))%mod<<endl;

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

int main() {
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    cout << a*d - c*b << endl;
}