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: import math
  
  
  class Solution:
  
      def solve(self, N: int, M: int) -> int:
  
          mod = 10**9 + 7
          INT_MAX = 10**9
  
          # calculate {m+n}C{n}
  
          def egcd(a, b):
              if a == 0:
                  return b, 0, 1
              else:
                  g, y, x = egcd(b % a, a)
                  return g, x - (b // a) * y, y
  
          def modinv(a, m):
              g, x, y = egcd(a, m)
              if g != 1:
                  raise Exception("modular inverse does not exist")
              else:
                  return x % m
  
          def combination(n: int, r: int, mod: int = 10**9 + 7) -> int:
              r = min(r, n - r)
              res = 1
              for i in range(r):
                  res = res * (n - i) * modinv(i + 1, mod) % mod
              return res
  
          # solve
  
          m = M
          answer = 1
          factors = {}
          for i in range(2, int(math.sqrt(M)) + 1):
              factor = 0
              while m % i == 0:
                  m //= i
                  factor += 1
  
              if factor > 0:
                  answer *= combination(N + factor - 1, N - 1, mod=mod)
                  answer %= mod
  
          if m > 1:
              answer *= N
              answer %= mod
  
          return answer
  
  
  if __name__ == "__main__":
  
      # standard input
      N, M = map(int, input().split())
  
      # solve
      solution = Solution()
      print(solution.solve(N, M))
  
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"}]