implicit none

integer(8),parameter :: s0 = 0
integer(8) :: u,v,a,b,t,s
integer(8) :: N
read *, N

s = s0
do v = 0,N
  do u = 0,v
    do a = 0,v
      b = v-a
      if ((a == u) .and. (b /= u)) then
        exit
      else if ((a /= u) .and. (b == u)) then
        exit
      end if
    end do
  s = s + 1
  end do
end do
t = mod(s,10 ** 9 + 7)
print *, t

end program 