output_description: Print the number of the sequences consisting of positive integers that satisfy
  the condition, modulo 10^9 + 7.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N M
attempt: # encoding: utf-8
  import math
  N, M = map(int, input().split())
  
  def distribute(pos, full, tmp):
      return memo[tmp][pos]
  
  # define search range
  p_max = int(M / 2) # M is prime if M has a factor p (> p_max)
  ip_up = int(math.log2(p_max))
  
  #### O(MlogM) below (if M has a very large prime factor)
  M_tmp = M
  ips = []
  for p in range(2, p_max + 1):
      if M_tmp % p > 0: continue
      # how many times M_tmp can be divided
      p_tmp = p
      for i_p in range(ip_up + 1):
          if M_tmp % p_tmp > 0: break
          p_tmp = p_tmp * p
      # calculate later
      ips.append(i_p)
      # next
      M_tmp = M_tmp // (p_tmp // p)
      if M_tmp == 1: break
  #### O(Mlog M) above
  
  #### O(N) below
  # create memo
  ## init
  if len(ips) > 0: ip_max = max(ips)
  else: ip_max = 0
  memo = [[None] * N for i in range(ip_max + 1)] # max ip
  for j in range(N): memo[0][j] = 1
  for i in range(1, ip_max + 1): memo[i][N - 1] = 1
  ## fill
  for i in range(1, ip_max + 1):
      sum_tmp = 0
      vals = list(memo[i - 1])[::-1]
      p_memo = memo[i]
      for j, val in enumerate(vals):
          sum_tmp += val
          p_memo[N - 1 - j] = sum_tmp
  #### O(N) above
          
  # calculate ans
  ans = 1
  for i_p in ips: ans = (ans * distribute(0, i_p, i_p)) % (10 ** 9 + 7)
  
  if ip_max = 0: print(N)
  else: print(ans)
problem_description: Statement
  
  You are given positive integers N and M.
  
  How many sequences a of length N consisting of positive integers satisfy a_1
  \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7.
  
  Here, two sequences a' and a'' are considered different when there exists some
  i such that a_i' \neq a_i''.
samples: [{"input": "2 6", "output": "4\n    \n\nFour sequences satisfy the condition: \\\\{a_1, a_2\\\\} = \\\\{1, 6\\\\}, \\\\{2, 3\\\\},\n\\\\{3, 2\\\\} and \\\\{6, 1\\\\}.\n\n* * *"}, {"input": "3 12", "output": "18\n    \n\n* * *"}, {"input": "100000 1000000000", "output": "957870001"}]