#include<stdio.h>
#include<stdlib.h>
#define  ll long long
#define MOD 1000000007

ll rui(ll a,ll b){
  a*=a;
  b--;
  if(b==0)return a;
  else rui(a,b);
};  

int main(){
  ll n,k,ans=0;
  scanf("%lld %lld",&n,&k);
  for(ll a=k;a!=0;a--){
    ll c=k/a;
    ans+=rui(c,n)%MOD;
  };
  ans%=MOD;
  printf("%lld",ans);
};
