module prime_factorization
  implicit none
  integer :: num, p(1000)
contains
  subroutine prime_factor(n,f,m)
    implicit none
    integer, intent(in) :: n
    integer, intent(inout) :: f(:), m
    integer :: i, k, x, y
    m = 0
    f = 0
    k = 1
    x = n
    do
      y = x
      do i = k, num
        if (mod(x,p(i)).eq.0) then
          m = m+1
          f(m) = p(i)
          k = i
          x = x/p(i)
          exit
        end if
      end do
      if (x.eq.1) exit
      if (x.eq.y) then
        m = m+1
        f(m) = x
        exit
      end if
    end do
    return
  end subroutine prime_factor
  subroutine primes(n)
    implicit none
    integer, intent(in) :: n
    integer :: i, j
    logical :: s(n)
    s = .false.
    s(1) = .true.
    do i = 1, n
      if (s(i)) cycle
      do j = 2*i, n, i
        s(j) = .true.
      end do
    end do
    num = 0
    p = 0
    do i = 1, n
      if (i*i.gt.n) exit
      if (s(i)) cycle
      num = num+1
      p(num) = i
    end do
    return
  end subroutine primes
end module prime_factorization
program factors_of_factorial
  use prime_factorization
  implicit none
  integer(8), parameter :: md = 1000000007_8
  integer(8) :: cnt(1000) = 0_8, m = 1_8
  integer :: n, i, j, s, f(50) = 0
  read(*,*) n
  call primes(n)
  do i = 2, n
    call prime_factor(i,f,s)
    do j = 1, s
      cnt(f(j)) = cnt(f(j))+1_8
    end do
  end do
  do i = 1, n
    m = mod(m*(cnt(i)+1_8),md)
  end do
  write(*,'(i0)') m
  stop
end program factors_of_factorial