modulo = 1000000007

inline = [int(x) for x in input().split(' ')]

row = max(inline[0], inline[1])
col = min(inline[0], inline[1])

if row > 1 and col > 1:

    rowrec = [0] * row
    rowrec[0] = 2
    rowrec[1] = 4

    for i in range(2, row):
        rowrec[i] = (rowrec[i-1]+rowrec[i-2]) % modulo

    colrec = [0]*col
    colrec[0] = rowrec[row-1]
    colrec[1] = 2+colrec[0]

    for i in range(2, col):
        colrec[i] = (colrec[i-1] + rowrec[i-2]) % modulo
    print(colrec[col-1])

else:
    theOne = max(row, col)
    rowrec = [0] * theOne
    if theOne == 1:
        print(2)
    else:
        rowrec[0] = 2
        rowrec[1] = 4

        for i in range(2, theOne):
            rowrec[i] = (rowrec[i - 1] + rowrec[i - 2]) % modulo

        print(rowrec[theOne-1])
