#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rrep(i,n) rrepi(i,n-1,0-1)
#define rrepi(i,a,b) for(int i=int(a);i>int(b);--i)
#define ALL(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define show(v) rep(i,v.size()){cout<<v[i]<<" ";}cout<<endl;
//#define MOD 1000000007
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define SZ(x) ((int)(x).size())
#define SUM(v,i) accumulate(ALL(v),i)
#define debug(a) cout<<a<<endl;
using ll = long long;
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }//最大公約数
int lcm(int a, int b) { return a * b / gcd(a, b); }	//最小公倍数
#define deg_to_rad(deg) (((deg)/360)*2*PI);
#define rad_to_deg(rad) (((rad)/2/PI)*360);
//template <typename... Args>void IN(Args& ... args) {cin >>args;IN(args...);return;} //まとめて入力　IN(a,b,c,d...)
struct aaa { aaa() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; }aaa;

bool IsPrime(int num)
{
	if (num < 2) return false;
	else if (num == 2) return true;
	else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

	double sqrtNum = sqrt(num);
	for (int i = 3; i <= sqrtNum; i += 2)
	{
		if (num % i == 0)
		{
			// 素数ではない
			return false;
		}
	}

	// 素数である
	return true;
}

const int mod = 1000000007;
struct mint {
    ll x;
    mint(ll x = 0) :x(x% mod) {}
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod - a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint a) const {
        mint res(*this);
        return res += a;
    }
    mint operator-(const mint a) const {
        mint res(*this);
        return res -= a;
    }
    mint operator*(const mint a) const {
        mint res(*this);
        return res *= a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);  
        //debug(a.x);

        a *= a;
        if (t & 1) a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const {
        return pow(mod - 2);
    }
    mint& operator/=(const mint a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint a) const {
        mint res(*this);
        return res /= a;
    }
};



map<int, int> GetPrimeFactors(ll n) {
    map<int, int> mp;
    // dived by 2, 3, 5, ...
    for (int i = 2; i * i <= n; i += 2) {
        if (i == 4) i = 3;
        while (n % i == 0) {
            ++mp[i];
            n /= i;
        }
    }
    if (n != 1) ++mp[n];

    return mp;
}


// a^n mod を計算する
long long modpow(long long a, long long n, long long Mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % Mod;
        a = a * a % Mod;
        n >>= 1;
    }
    return res;
}


int n, m, k, w, h;
string s;

void solve() {
    ll n, m; cin >> n >> m;
    if (n == 1) {
        cout << m;
        return;
    }
    else if (m == 1) {
        cout << 1;
        return;
    }
    int ans=1;
    map<int, int> a = GetPrimeFactors(m);
    for (auto i : a) {
        ans *= pow(i.first, i.second / n);
        //cout << i.first<<":"<<i.second << endl;
    }
    cout << (ans);



}


signed main() {
	solve();
	return 0;
}


Measured memory_bytes: 256