#include <bits/stdc++.h>
typedef long double ld;
#define int long long
#define gcd __gcd
#define endl "\n"
#define setbits(x) __builtin_popcountll(x)
#define zrobits(x) __builtin_ctzll(x)
#define mod 1000000007
#define mod2 998244353
#define maxe *max_element
#define mine *min_element
#define inf 1e18
#define pb push_back
#define all(x) x.begin(), x.end()
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define ins insert
#define sz(x) (int)(x).size()
#define mk make_pair
#define deci(x, y) fixed<<setprecision(y)<<x
#define w(t) int t; cin>>t; while(t--)
#define nitin ios_base::sync_with_stdio(false); cin.tie(nullptr)
#define PI 3.141592653589793238
#define mem0(x) memset(x,0,sizeof x)
#define mem1(x) memset(x,-1,sizeof x)
#define pr pair<int,int>
#define vi vector<int>
#define vvi vector<vi>
#define vpr vector<pr>
using namespace std;
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.f << ", " << p.second << ')'; }
template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::value_type>::type> ostream& operator<<(ostream &os, const T_container &v) { os << '{'; string sep; for (const T &x : v) os << sep << x, sep = ", "; return os << '}'; }
void dbg_out() { cerr << endl; }
template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cerr << ' ' << H; dbg_out(T...); }
#ifdef NITIN
#define dbg(...) cerr << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__)
#else
#define dbg(...)
#endif
int power(int x, int y, int p) {
int res = 1;
x = x % p;
while (y > 0) {
if (y & 1)
res = (res * x) % p;
y = y >> 1;
x = (x * x) % p;
}
return res;
}
int modi(int a, int m) {
return power(a, m - 2, m);
}
void solve() {
int b,w;
cin>>b>>w;
int top=b*(b-1);
top%=mod;
int bottom=((b+w-1)*(b+w-1)-w*w);
bottom%=mod;
top+=bottom;
top%=mod;
top*=w;
top%=mod;
bottom*=(b+2*w);
bottom%=mod;
top%=mod;
bottom%=mod;
top*=modi(bottom,mod);
cout<<top%mod<<endl;
}
int32_t main() {
nitin;
solve();
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+Cgp0eXBlZGVmIGxvbmcgZG91YmxlIGxkOwojZGVmaW5lIGludCBsb25nIGxvbmcKCiNkZWZpbmUgZ2NkICAgICAgICAgICAgX19nY2QKI2RlZmluZSBlbmRsICAgICAgICAgICAiXG4iCiNkZWZpbmUgc2V0Yml0cyh4KSAgICAgX19idWlsdGluX3BvcGNvdW50bGwoeCkKI2RlZmluZSB6cm9iaXRzKHgpICAgICBfX2J1aWx0aW5fY3R6bGwoeCkKI2RlZmluZSBtb2QgICAgICAgICAgICAxMDAwMDAwMDA3CiNkZWZpbmUgbW9kMiAgICAgICAgICAgOTk4MjQ0MzUzCiNkZWZpbmUgbWF4ZSAgICAgICAgICAgKm1heF9lbGVtZW50CiNkZWZpbmUgbWluZSAgICAgICAgICAgKm1pbl9lbGVtZW50CiNkZWZpbmUgaW5mICAgICAgICAgICAgMWUxOAojZGVmaW5lIHBiICAgICAgICAgICAgIHB1c2hfYmFjawojZGVmaW5lIGFsbCh4KSAgICAgICAgIHguYmVnaW4oKSwgeC5lbmQoKQojZGVmaW5lIGYgICAgICAgICAgICAgIGZpcnN0CiNkZWZpbmUgcyAgICAgICAgICAgICAgc2Vjb25kCiNkZWZpbmUgbGIgICAgICAgICAgICAgbG93ZXJfYm91bmQKI2RlZmluZSB1YiAgICAgICAgICAgICB1cHBlcl9ib3VuZAojZGVmaW5lIGlucyAgICAgICAgICAgIGluc2VydAojZGVmaW5lIHN6KHgpICAgICAgICAgIChpbnQpKHgpLnNpemUoKQojZGVmaW5lIG1rICAgICAgICAgICAgIG1ha2VfcGFpcgojZGVmaW5lIGRlY2koeCwgeSkgICAgIGZpeGVkPDxzZXRwcmVjaXNpb24oeSk8PHgKI2RlZmluZSB3KHQpICAgICAgICAgICBpbnQgdDsgY2luPj50OyB3aGlsZSh0LS0pCiNkZWZpbmUgbml0aW4gICAgICAgICAgaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGR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