program range_set
  integer :: n,a,b
  integer(8) :: modu=1000000007,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
  endif
  g(1,2)=1
  do i=2,b-1
    g(i,2)=mod(sum(g(i-1,:)),modu)
    g(i,1)=mod(sum(g(1:i-a,2)),modu)
  enddo
  f(0,:)=1
  do i=1,n
    x=mod(x*2,modu)
    f(i,1)=mod(sum(f(max(i-a+1,0):i-1,2)),modu)
    do j=1,min(b-1,i)
      if(i==n)f(i,1)=mod(f(i,1)+f(i-j,1)*g(j,1),modu)
      f(i,2)=mod(f(i,2)+merge(sum(g(j,:)),mod(f(i-j,1)*g(j,2),modu),j==i),modu)
    enddo
  enddo
  print'(i0)',modulo(x-sum(f(n,:)),modu)
end program range_set