from typing import List
def barrels(a,b,k,c):
    if c in [a,b]:
        return int(((2**k) * k) / 2 % 1000000007)
 

#print(barrels(6,5,2,6))

