output_description: Print the sum of \gcd(A_1, ..., A_N) over all K^N sequences, modulo (10^9+7).
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N K
attempt: n, k = map(int, input().split())
  
  MOD = 10**9 + 7
  
  
  class mint:
      def __init__(self, i):
          self.i = i
  
      def __add__(self, m):
          t = self.i + (m.i if isinstance(m, mint) else m)
          if t > MOD:
              t -= MOD
          return mint(t)
  
      def __radd__(self, m):
          t = self.i + (m.i if isinstance(m, mint) else m)
          if t > MOD:
              t -= MOD
          return mint(t)
  
      def __mul__(self, m):
          return mint(self.i * m.i % MOD)
  
      def __sub__(self, m):
          t = self.i - m.i
          if t < 0:
              t += MOD
          return mint(t)
  
      def __pow__(self, m):
          i = self.i
          res = 1
          while m > 0:
              if m & 1:
                  res = res * i % MOD
              i = i * i % MOD
              m >>= 1
          return mint(res)
  
      def __truediv__(self, m):
          return mint(self.i * m ** (MOD - 2) % MOD)
  
      def __repr__(self):
          return repr(self.i)
  
  
  l = [mint(0) for _ in range(k + 1)]
  
  for x in range(k, 0, -1):
      count = mint(k // x) ** n
      for tx in range(x + x, k + 1, x):
          count -= l[tx]
      l[x] = count
  
  ans = sum(mint(i) * x for i, x in enumerate(l))
  print(ans)
  
problem_description: Statement
  
  Consider sequences \\{A_1,...,A_N\\} of length N consisting of integers
  between 1 and K (inclusive).
  
  There are K^N such sequences. Find the sum of \gcd(A_1, ..., A_N) over all of
  them.
  
  Since this sum can be enormous, print the value modulo (10^9+7).
  
  Here \gcd(A_1, ..., A_N) denotes the greatest common divisor of A_1, ..., A_N.
samples: [{"input": "3 2", "output": "9\n    \n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2) =1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\n* * *"}, {"input": "3 200", "output": "10813692\n    \n\n* * *"}, {"input": "100000 100000", "output": "742202979\n    \n\nBe sure to print the sum modulo (10^9+7)."}]