program range_set
  implicit none
  integer(8), parameter :: modu = 1000000007
  integer :: n, a, b, i, j
  integer(8) :: x = 1, f(0:5000, 2) = 0, g(0:5000, 2) = 0
  read(*,*) n, a, b
  if (a > b) then
    i = a
    a = b
    b = i
  end if
  g(1, 2) = 1
  do i = 2, b - 1
    g(i, 2) = mod(g(i - 1, 1) + g(i - 1, 2), modu)
    g(i, 1) = mod(sum(g(1:i - a, 2)), modu)
  end do
  f(0, :) = 1
  do i = 1, n - 1
    x = x + x
    if (x > modu) x = x - modu
    f(i, 1) = mod(sum(f(max(i - a + 1, 0):i - 1, 2)), modu)
    if (i < b) then
      do j = 1, i - 1
        f(i, 2) = f(i, 2) + mod(f(i - j, 1) * g(j, 2), modu)
      end do
      f(i, 2) = mod(f(i, 2) + g(j, 1) + g(j, 2), modu)
    else
      do j = 1, b - 1
        if (i == n) f(i, 1) = mod(f(i, 1) + f(i - j, 1) * g(j, 1), modu)
        f(i, 2) = f(i, 2) + mod(f(i - j, 1) * g(j, 2), modu)
      end do
      f(i, 2) = mod(f(i, 2), modu)
    end if
  end do
  x = x + x
  f(n, 1) = mod(sum(f(n - a + 1:n - 1, 2)), modu)
  do j = 1, b - 1
    f(n, 1) = f(n, 1) + mod(f(n - j, 1) * g(j, 1), modu)
    f(n, 2) = f(n, 2) + mod(f(n - j, 1) * g(j, 2), modu)
  end do
  write(*,'(i0)') modulo(x - f(n, 1) - f(n, 2), modu)
end program range_set