Buggy python submission (verdict: Time Limit Exceeded):
B, W = list(map(int, input().split()))

MOD = 10**9+7
facts = [1,1]
invs = [1,1]
invfacts = [1,1]
for ind in range(1, B+W):
    i = ind+1
    facts += [ facts[-1]*i % MOD ]
    invs += [ -(MOD//i)*invs[MOD%i] % MOD ]
    invfacts += [ invfacts[-1]*invs[i] % MOD ]

y_pi = 0 #i回目までにBを食べ尽くした確率piの分子
y_qi = 0 #i回目までにWを食べ尽くした確率qiの分子
pow2 = 1
inv2i = 1
for i in range(B+W):
    y_pi = 0 if i < B else 2*y_pi + ((facts[i-1]*invfacts[i-B] % MOD)*invfacts[B-1] % MOD)
    y_qi = 0 if i < W else 2*y_qi + ((facts[i-1]*invfacts[i-W] % MOD)*invfacts[W-1] % MOD)
    invxi = inv2i * invs[2] % MOD
    yi = (pow2-y_pi+y_qi) % MOD
    z = yi*invxi % MOD
    print(z)
    pow2 = pow2*2 %MOD
    inv2i = invxi

Fixed submission:
B, W = list(map(int, input().split()))

MOD = 10**9+7

facts = [1,1] #階乗
invs = [1,1] #整数の逆元
invfacts = [1,1] #階乗の逆元
for ind in range(1, B+W):
    i = ind+1
    facts.append(facts[-1]*i % MOD)
    invs.append( -(MOD//i)*invs[MOD%i] % MOD )
    invfacts.append( invfacts[-1]*invs[i] % MOD )

def Comb(n, r, MOD=MOD):
    if n < r:
        return 0
    return facts[n]*invfacts[n-r]*invfacts[r] % MOD

y_pi = 0 #i回目までにBを食べ尽くした確率piの分子
y_qi = 0 #i回目までにWを食べ尽くした確率qiの分子
pow2 = 1
invxi = 1
inv2 = invs[2]
for i in range(B+W):
    #y_pi = 0 if i < B else 2*y_pi + ((facts[i-1]*invfacts[i-B] % MOD)*invfacts[B-1] % MOD)
    y_pi = (2*y_pi + Comb(i-1, B-1))%MOD
    #y_qi = 0 if i < W else 2*y_qi + ((facts[i-1]*invfacts[i-W] % MOD)*invfacts[W-1] % MOD)
    y_qi = (2*y_qi + Comb(i-1, W-1))%MOD
    invxi = invxi * inv2 % MOD
    yi = (pow2-y_pi+y_qi) % MOD
    z = yi*invxi % MOD
    print(z)
    pow2 = pow2*2 %MOD

Buggy python submission (verdict: Time Limit Exceeded):
B, W = list(map(int, input().split()))

MOD = 10**9+7
combB1 = 0
combW1 = 0
y_pi = 0 #i回目までにBを食べ尽くした確率piの分子
y_qi = 0 #i回目までにWを食べ尽くした確率qiの分子
pow2list = [1]
invmod = {}
for i in range(B+W):
    pow2list += [pow2list[-1]*2 %MOD]
    y_pi = 0 if i < B else 2*y_pi + combB1
    y_qi = 0 if i < W else 2*y_qi + combW1
    xi = pow2list[i+1]
    if xi in invmod:
        invxi = invmod[xi]
    else:
        invxi = pow(xi, MOD-2, MOD)
        invmod[xi] = invxi
    yi = (pow2list[i]-y_pi+y_qi) % MOD
    z = yi*invxi % MOD
    print(int(z))
    if i < B-1:
        combB1 = 0
    elif i == B-1:
        combB1 = 1
    else:
        if i-B+1 in invmod:
            invB = invmod[i-B+1]
        else:
            invB = pow(i-B+1, MOD-2, MOD)
            invmod[i-B+1] = invB
        combB1 = combB1*i*invB % MOD
    if i < W-1:
        combW1 = 0
    elif i == W-1:
        combW1 = 1
    else:
        if i-W+1 in invmod:
            invW = invmod[i-W+1]
        else:
            invW = pow(i-W+1, MOD-2, MOD)
            invmod[i-W+1] = invW
        combW1 = combW1*i*invW % MOD

Fixed submission:
B, W = list(map(int, input().split()))

MOD = 10**9+7

facts = [1,1] #階乗
invs = [1,1] #整数の逆元
invfacts = [1,1] #階乗の逆元
for ind in range(1, B+W):
    i = ind+1
    facts.append(facts[-1]*i % MOD)
    invs.append( -(MOD//i)*invs[MOD%i] % MOD )
    invfacts.append( invfacts[-1]*invs[i] % MOD )

def Comb(n, r, MOD=MOD):
    if n < r:
        return 0
    return facts[n]*invfacts[n-r]*invfacts[r] % MOD

y_pi = 0 #i回目までにBを食べ尽くした確率piの分子
y_qi = 0 #i回目までにWを食べ尽くした確率qiの分子
pow2 = 1
invxi = 1
inv2 = invs[2]
for i in range(B+W):
    #y_pi = 0 if i < B else 2*y_pi + ((facts[i-1]*invfacts[i-B] % MOD)*invfacts[B-1] % MOD)
    y_pi = (2*y_pi + Comb(i-1, B-1))%MOD
    #y_qi = 0 if i < W else 2*y_qi + ((facts[i-1]*invfacts[i-W] % MOD)*invfacts[W-1] % MOD)
    y_qi = (2*y_qi + Comb(i-1, W-1))%MOD
    invxi = invxi * inv2 % MOD
    yi = (pow2-y_pi+y_qi) % MOD
    z = yi*invxi % MOD
    print(z)
    pow2 = pow2*2 %MOD

Buggy python submission (verdict: Time Limit Exceeded):
B, W = list(map(int, input().split()))

MOD = 10**9+7
def MakeCombList(n,r, MOD): #iCrをi=0...nまで
    ret = []
    for i in range(n):
        if i < r:
            ret = ret+[0]
        elif i == r:
            ret = ret+[1]
        else:
            ret = ret+[ int(ret[-1]*(i)/(i-r)) % MOD]
    return ret
combB1 = MakeCombList(B+W, B-1, MOD)
combW1 = MakeCombList(B+W, W-1, MOD)

y_pi = 0 #i回目までにBを食べ尽くした確率piの分子
y_qi = 0 #i回目までにWを食べ尽くした確率qiの分子
for i in range(B+W):
    y_pi = 0 if i < B else 2*y_pi + combB1[i-1] 
    y_qi = 0 if i < W else 2*y_qi + combW1[i-1]
    xi = pow(2,i+1,MOD)
    yi = (pow(2,i,MOD)-y_pi+y_qi) % MOD
    z = yi*pow(xi, MOD-2, MOD) % MOD
    print(z)

Fixed submission:
B, W = list(map(int, input().split()))

MOD = 10**9+7

facts = [1,1] #階乗
invs = [1,1] #整数の逆元
invfacts = [1,1] #階乗の逆元
for ind in range(1, B+W):
    i = ind+1
    facts.append(facts[-1]*i % MOD)
    invs.append( -(MOD//i)*invs[MOD%i] % MOD )
    invfacts.append( invfacts[-1]*invs[i] % MOD )

def Comb(n, r, MOD=MOD):
    if n < r:
        return 0
    return facts[n]*invfacts[n-r]*invfacts[r] % MOD

y_pi = 0 #i回目までにBを食べ尽くした確率piの分子
y_qi = 0 #i回目までにWを食べ尽くした確率qiの分子
pow2 = 1
invxi = 1
inv2 = invs[2]
for i in range(B+W):
    #y_pi = 0 if i < B else 2*y_pi + ((facts[i-1]*invfacts[i-B] % MOD)*invfacts[B-1] % MOD)
    y_pi = (2*y_pi + Comb(i-1, B-1))%MOD
    #y_qi = 0 if i < W else 2*y_qi + ((facts[i-1]*invfacts[i-W] % MOD)*invfacts[W-1] % MOD)
    y_qi = (2*y_qi + Comb(i-1, W-1))%MOD
    invxi = invxi * inv2 % MOD
    yi = (pow2-y_pi+y_qi) % MOD
    z = yi*invxi % MOD
    print(z)
    pow2 = pow2*2 %MOD

Buggy python submission (verdict: Time Limit Exceeded):
B, W = list(map(int, input().split()))

MOD = 10**9+7
def MakeCombList(n,r, MOD): #iCrをi=0...nまで
    ret = []
    for i in range(n):
        if i < r:
            ret = ret+[0]
        elif i == r:
            ret = ret+[1]
        else:
            ret = ret+[ int(ret[-1]*(i)/(i-r)) % MOD]
    return ret
combB1 = MakeCombList(B+W, B-1, MOD)
combW1 = MakeCombList(B+W, W-1, MOD)

pow2list = [1]
y_pi = 0 #i回目までにBを食べ尽くした確率piの分子
y_qi = 0 #i回目までにWを食べ尽くした確率qiの分子
for i in range(B+W):
    pow2list += [pow2list[-1]*2 %MOD]
    y_pi = 0 if i < B else 2*y_pi + combB1[i-1] 
    y_qi = 0 if i < W else 2*y_qi + combW1[i-1]
    xi = pow2list[i+1]
    yi = (pow2list[i]-y_pi+y_qi) % MOD
    z = yi*pow(xi, MOD-2, MOD) % MOD
    #print("{}/{}: {}".format(yi,xi,z))
    print(z)

Fixed submission:
B, W = list(map(int, input().split()))

MOD = 10**9+7

facts = [1,1] #階乗
invs = [1,1] #整数の逆元
invfacts = [1,1] #階乗の逆元
for ind in range(1, B+W):
    i = ind+1
    facts.append(facts[-1]*i % MOD)
    invs.append( -(MOD//i)*invs[MOD%i] % MOD )
    invfacts.append( invfacts[-1]*invs[i] % MOD )

def Comb(n, r, MOD=MOD):
    if n < r:
        return 0
    return facts[n]*invfacts[n-r]*invfacts[r] % MOD

y_pi = 0 #i回目までにBを食べ尽くした確率piの分子
y_qi = 0 #i回目までにWを食べ尽くした確率qiの分子
pow2 = 1
invxi = 1
inv2 = invs[2]
for i in range(B+W):
    #y_pi = 0 if i < B else 2*y_pi + ((facts[i-1]*invfacts[i-B] % MOD)*invfacts[B-1] % MOD)
    y_pi = (2*y_pi + Comb(i-1, B-1))%MOD
    #y_qi = 0 if i < W else 2*y_qi + ((facts[i-1]*invfacts[i-W] % MOD)*invfacts[W-1] % MOD)
    y_qi = (2*y_qi + Comb(i-1, W-1))%MOD
    invxi = invxi * inv2 % MOD
    yi = (pow2-y_pi+y_qi) % MOD
    z = yi*invxi % MOD
    print(z)
    pow2 = pow2*2 %MOD