import kotlin.math.max

const val MOD = 1000000007L

fun main() {
    var (n, a, b) = readLine()!!.split(" ").map { it.toInt() }
    if (b < a) {
        val c = b
        b = a
        a = c
    }
    val pow2 = LongArray(n + 1)
    pow2[0] = 1L
    for (j in 1..n) {
        pow2[j] = (2L * pow2[j - 1]) % MOD
    }
    if (a == 1) {
        println(pow2[n])
    } else {
        val dp = Array(n + 1) { LongArray(b + 1) }
        val dpOverall = LongArray(n + 1)
        dp[0][0] = 1L
        dpOverall[0] = 1L
        var answer = pow2[n - b]
        //println("\tanswer = $answer")
        for (j in 1..n) {
            for (k in 1..b) {
                dp[j][k] = when (k) {
                    1 -> if (j == 1) 1L else {
                        var res = 0L
                        for (j2 in max(0, j - a) until j - 1) {
                            res += dpOverall[j2]
                        }
                        res
                    }
                    2 -> dp[j - 1][1]
                    else -> (2L * dp[j - 1][k - 1]) - (if (j >= 2 && k >= 2) dp[j - 2][k - 2] else 0L) + (if (j >= a + 1 && k >= a + 1) dp[j - 1 - a][k - 1 - a] else 0L)
                }
                dp[j][k] %= MOD
                if (k != b) {
                    dpOverall[j] += dp[j][k]
                }
                //println("dp[$j][$k] = ${dp[j][k]}")
                if (k == b) {
                    answer += pow2[n - j] * dp[j][b]
                    answer %= MOD
                } else if (j + max(a, b - k) <= n) {
                    answer += pow2[n - (j + max(a, b - k))] * dp[j][k]
                    answer %= MOD
                }
                //println("\tanswer = $answer")
            }
            dpOverall[j] %= MOD
        }
        answer += MOD
        answer %= MOD
        println(answer)
    }
}