stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
/*

  Code By RyeCatcher

*/

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <algorithm>

#include <cctype>

#include <vector>

#include <queue>

#include <cmath>

#include <utility>

#define ri register int

#define ll long long

#define ull unsigned long long

#define pb push_back

#define DEBUG freopen("dat.in","r",stdin);freopen("wa.out","w".stdout);

#define FO(x) {freopen(#x".in","r",stdin);freopen(#x".out","w",stdout);}

using std::min;

using std::max;

using std::pair;

using std::queue;

using std::priority_queue;

using std::vector;

#define gc getchar

template <class T>inline void read(T &x){

	x=0;int ne=0;char c;

    while((c=gc())>'9'||c<'0')ne=c=='-';x=c-48;

    while((c=gc())>='0'&&c<='9')x=(x<<3)+(x<<1)+c-48;x=ne?-x:x;return ;

}

const int maxn=100155;

const int size=100150;

const int inf=0x7fffffff;

const ll P=1e9+7;

int n,m;

int c[maxn],tot=0;

ll fac[maxn],inv_fac[maxn];

ll C(int n,int m){

	return fac[m]*inv_fac[n]%P*inv_fac[m-n]%P;

}

ll ksm(ll a){

	ll ans=1;

	ll c=P-2;

	while(c){

		if(c&1)ans=ans*a%P;

		a=a*a%P;

		c=c>>1;

	}

	return ans%P;

}

int main(){

	int x,y,M;

	read(n),read(m);

	M=m;

	for(ri i=2;i*i<=M;i++){

		if(M%i==0){

			c[++tot]=1;

			M/=i;

			while(M%i==0){M/=i;c[tot]++;}

		}

	}

	if(M>1)c[++tot]=1;

	fac[0]=fac[1]=1;

	for(ri i=2;i<=size;i++)

		fac[i]=fac[i-1]*i%P;

	inv_fac[size]=ksm(fac[size]);

	for(ri i=size-1;i>=0;i--)

		inv_fac[i]=inv_fac[i+1]*1ll*(i+1)%P;

	ll ans=1;

	for(ri i=1;i<=tot;i++){

		ans=ans*C(n-1,n+c[i]-1)%P;

	}

	printf("%lld\n",ans);

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.721628023003558x):
#include<stdio.h>

#include<stdlib.h>

#include<string.h>

#include<math.h>

#include<algorithm>

#include<queue>

#include<set>

#include<map>

#include<iostream>

using namespace std;

#define ll long long

#define REP(a,b,c) for(int a=b;a<=c;a++)

#define re register

#define file(a) freopen(a".in","r",stdin);freopen(a".out","w",stdout)

typedef pair<int,int> pii;

#define mp make_pair

inline int gi()

{

	int f=1,sum=0;char ch=getchar();

	while(ch>'9' || ch<'0'){if(ch=='-')f=-1;ch=getchar();}

	while(ch>='0' && ch<='9'){sum=(sum<<3)+(sum<<1)+ch-'0';ch=getchar();}

	return f*sum;

}

const int N=50,Mod=1e9+7;

int n,m,stk[N],f[100010][N],top;

int main()

{

	n=gi();m=gi();

	for(int i=2;i*i<=m;i++)

		if(m%i==0)

		{

			top++;int s=0;

			while(m%i==0)

			{

				s++;m/=i;

			}

			stk[top]=s;

		}

	if(m!=1)stk[++top]=1;

	f[0][0]=1;

	for(int i=1;i<=n;i++)

		for(int j=0;j<=40;j++)

			for(int k=0;k<=j;k++)f[i][j]=(f[i-1][j-k]+f[i][j])%Mod;

	ll ans=1;

	for(int i=1;i<=top;i++)ans=1ll*ans*f[n][stk[i]]%Mod;

	printf("%lld\n",ans);

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define LL long long

#define db double

using namespace std;

 

const int MAXN = (1 << 17 | 3);

const int MAXE = 400400;

const int INF = 0x3f3f3f3f;

 

template<typename T> inline void CheckMax(T &A, T B) {

	A < B ? A = B : A;

}

 

template<typename T> inline void CheckMin(T &A, T B) {

	A > B ? A = B : A;

}

 

template <typename T> inline void read(T &x) {

    int c = getchar();

    bool f = false;

    for (x = 0; !isdigit(c); c = getchar()) {

        if (c == '-') {

            f = true;

        }

    }

    for (; isdigit(c); c = getchar()) {

        x = x * 10 + c - '0';

    }

    if (f) {

        x = -x;

    }

}

 

LL n, m;

LL P[MAXN], cnt;



const LL mod = 1000000007;



LL qpow(LL a, LL b) {

	LL ret = 1;

	while(b) {

		if(b & 1) ret *= a;

		ret %= mod;

		a = a * a % mod;

		b >>= 1;

	}

	return ret;

}



#define inv(x) qpow(x, mod - 2)

LL fac[MAXN + 10];



void init() {

	fac[0] = 1;

	for(LL i = 1; i <= MAXN; i++) fac[i] = fac[i - 1] * i % mod;

}



LL C(LL a, LL b) {

    return (fac[a] * inv(fac[b]) % mod * inv(fac[a - b]) % mod);

}



void solve(LL x) {

	for(LL i = 2; i * i <= x; i++) {

		if(x % i == 0) {

			LL cur = 0;

			while(x % i == 0) {

				x /= i;

				cur++;

			}

			P[++cnt] = cur;

		}

	}

	if(x > 1) P[++cnt] = 1;

}

 

signed main() {

	cin >> n >> m;

	solve(m);

	LL ans = 1LL;

	init();

	for(LL i = 1; i <= cnt; i++) {

		ans *= (LL) C(P[i] + n - 1LL, n - 1LL) % mod;

		ans %= mod;

	}

	printf("%lld\n", ans);

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.133212978896847x):
#include<bits/stdc++.h>

using namespace std;

#define ll long long

#define p 1000000007

ll fac[100055];

int num[105];

inline ll qpow(int x,int a)

{

	ll ans=1;

	while(a)

	{

		if(a&1) ans=1ll*ans*x%p;

		x=1ll*x*x%p;

		a>>=1;

	}

	return ans;

}

inline ll C(int n,int m)

{

	return fac[n]*qpow(fac[m],p-2)%p*qpow(fac[n-m],p-2)%p;

}

int main()

{

	int n,m,cnt;

	fac[0]=1;

	for(int i=1;i<=100050;++i)

		fac[i]=fac[i-1]*i%p;

	scanf("%d%d",&n,&m);

	int tmp=sqrt(m);

	for(int i=2;i<=tmp;++i)

	{

		if(m%i) continue;

		num[++cnt]=0;

		while(!(m%i))

			m/=i,++num[cnt];

	}

	if(m!=1) num[++cnt]=1;

	ll ans=1;

	for(int i=1;i<=cnt;++i)

		ans=ans*C(n+num[i]-1,num[i])%p;

	printf("%lld\n",ans);

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef int ll;

typedef long long int li;

const ll MAXN=2e5+51,MOD=1e9+7;

ll cnt,num,ftot,res=1;

ll fact[MAXN],finv[MAXN],factor[MAXN],exponent[MAXN];

inline ll read()

{

    register ll num=0,neg=1;

    register char ch=getchar();

    while(!isdigit(ch)&&ch!='-')

    {

        ch=getchar();

    }

    if(ch=='-')

    {

        neg=-1;

        ch=getchar();

    }

    while(isdigit(ch))

    {

        num=(num<<3)+(num<<1)+(ch-'0');

        ch=getchar();

    }

    return num*neg;

}

inline ll qpow(ll base,ll exponent)

{

	ll res=1;

	while(exponent)

	{

		if(exponent&1)

		{

			res=(li)res*base%MOD;

		}

		base=(li)base*base%MOD,exponent>>=1;

	}

	return res;

}

inline void setup(ll cnt)

{

	fact[0]=fact[1]=finv[0]=1;

	for(register int i=2;i<=cnt;i++)

	{

		fact[i]=(li)fact[i-1]*i%MOD;

	}

	finv[cnt]=qpow(fact[cnt],MOD-2);

	for(register int i=cnt-1;i;i--)

	{

		finv[i]=(li)finv[i+1]*(i+1)%MOD;

	}

}

inline void getFact(ll num)

{

	for(register int i=2;i<=sqrt(num);i++)

	{

		if(num%i==0)

		{

			factor[++ftot]=i;

			while(num%i==0)

			{

				num/=i,exponent[ftot]++;

			}

		}

	}

	if(num!=1)

	{

		factor[++ftot]=num,exponent[ftot]=1;

	}

}

int main()

{

	cnt=read(),getFact(num=read()),setup(200000);

	for(register int i=1;i<=ftot;i++)

	{

		res=(li)res*fact[cnt+exponent[i]-1]%MOD;

		res=(li)res*finv[cnt-1]%MOD*finv[exponent[i]]%MOD;

	}

	printf("%d\n",res);

}


// Faster C++ solution for the same problem (measured speedup: 1.7407182448117882x):
#include<bits/stdc++.h>

using namespace std;

#define ll long long

#define p 1000000007

ll fac[100055];

int num[105];

inline ll qpow(int x,int a)

{

	ll ans=1;

	while(a)

	{

		if(a&1) ans=1ll*ans*x%p;

		x=1ll*x*x%p;

		a>>=1;

	}

	return ans;

}

inline ll C(int n,int m)

{

	return fac[n]*qpow(fac[m],p-2)%p*qpow(fac[n-m],p-2)%p;

}

int main()

{

	int n,m,cnt;

	fac[0]=1;

	for(int i=1;i<=100050;++i)

		fac[i]=fac[i-1]*i%p;

	scanf("%d%d",&n,&m);

	int tmp=sqrt(m);

	for(int i=2;i<=tmp;++i)

	{

		if(m%i) continue;

		num[++cnt]=0;

		while(!(m%i))

			m/=i,++num[cnt];

	}

	if(m!=1) num[++cnt]=1;

	ll ans=1;

	for(int i=1;i<=cnt;++i)

		ans=ans*C(n+num[i]-1,num[i])%p;

	printf("%lld\n",ans);

	return 0;

}
// Slower C++ solution:
// ===================================

//   author: M_sea

//   website: http://m-sea-blog.com/

// ===================================

#include <algorithm>

#include <iostream>

#include <cstdlib>

#include <cstring>

#include <cstdio>

#include <vector>

#include <cmath>

#define re register

using namespace std;



inline int read() {

    int X=0,w=1; char c=getchar();

    while (c<'0'||c>'9') { if (c=='-') w=-1; c=getchar(); }

    while (c>='0'&&c<='9') X=X*10+c-'0',c=getchar();

    return X*w;

}



const int N=100000+10;

const int mod=1000000007;

inline int qpow(int a,int b) { int c=1;

    for (;b;b>>=1,a=1ll*a*a%mod) if (b&1) c=1ll*c*a%mod;

    return c;

}



int n,m;

int v[N],cnt=0;

int dp[32][N];



int fac[N],ifac[N];

inline void init(int n) {

    fac[0]=1;

    for (re int i=1;i<=n;++i) fac[i]=1ll*fac[i-1]*i%mod;

    ifac[n]=qpow(fac[n],mod-2);

    for (re int i=n;i;--i) ifac[i-1]=1ll*ifac[i]*i%mod;

}

inline int C(int n,int m) {

    if (n<m) return 0;

    return 1ll*fac[n]*ifac[m]%mod*ifac[n-m]%mod;

}



int main() { init(1e5);

    n=read(),m=read();

    if (m==1) { puts("1"); return 0; }

    for (re int i=1;i*i<=m;++i) {

        if (m%i==0) {

            v[++cnt]=i;

            if (i*i!=m) v[++cnt]=m/i;

        }

    }

    sort(v+1,v+cnt+1); dp[0][1]=1;

    for (re int i=1;i<=min(n,31);++i)

        for (re int j=1;j<=cnt;++j)

            for (re int k=1;k<=j&&v[k]*2<=v[j];++k)

                if (v[j]%v[k]==0)

                    dp[i][j]=(dp[i][j]+dp[i-1][k])%mod;

    int ans=0;

    for (re int i=1;i<=min(n,31);++i)

        ans=(ans+1ll*C(n,i)*dp[i][cnt])%mod;

    printf("%d\n",ans);

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.2044185950425197x):
#include<bits/stdc++.h>

using namespace std;

#define ll long long

#define p 1000000007

ll fac[100055];

int num[105];

inline ll qpow(int x,int a)

{

	ll ans=1;

	while(a)

	{

		if(a&1) ans=1ll*ans*x%p;

		x=1ll*x*x%p;

		a>>=1;

	}

	return ans;

}

inline ll C(int n,int m)

{

	return fac[n]*qpow(fac[m],p-2)%p*qpow(fac[n-m],p-2)%p;

}

int main()

{

	int n,m,cnt;

	fac[0]=1;

	for(int i=1;i<=100050;++i)

		fac[i]=fac[i-1]*i%p;

	scanf("%d%d",&n,&m);

	int tmp=sqrt(m);

	for(int i=2;i<=tmp;++i)

	{

		if(m%i) continue;

		num[++cnt]=0;

		while(!(m%i))

			m/=i,++num[cnt];

	}

	if(m!=1) num[++cnt]=1;

	ll ans=1;

	for(int i=1;i<=cnt;++i)

		ans=ans*C(n+num[i]-1,num[i])%p;

	printf("%lld\n",ans);

	return 0;

}
// Slower C++ solution:


#include <bits/stdc++.h>

using namespace std;

 

const int MAXN = 2e5+2;

unsigned long long nums[MAXN];

 

const long long MAXL = 1e18;

 

//判断a*b是否超过1e18

bool overflow(unsigned long long a, unsigned long long b) {

    //判断是否越界

    if (ULLONG_MAX / a < b) {

        return true;

    }

    //判断是否超过1e18

    unsigned long long ans = a*b;

    if (ans>MAXL) {

        return true;

    }

    return false;

}

 

int main() {

    int n;

    scanf("%d", &n);

    for (int i=0; i<n; i++) {

        scanf("%llu", &nums[i]);

        if (0==nums[i]) {

            printf("0\n");

            return 0;

        }

    }

 

    long long ans=1;

    for (int i=0; i<n; i++) {

        if (true == overflow(ans, nums[i])) {

            printf("-1\n");

            return 0;

        }

        ans *= nums[i];

    }// 

    printf("%llu", ans); 

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.62462333309994x):
#include <stdio.h>



int main() {

    long long int r[100005], n, calc = 1;

    scanf("%lld", &n);

    for (int i = 0; i < n; i++) {

        scanf("%lld", &r[i]);

    }

    for (int i = 0; i < n; i++) {

        if (r[i] == 0) {

            printf("0");

            return 0;

        }

    }

    for (int i = 0; i < n; i++) {

        if (r[i] <= (1000000000000000000 / calc)) {

            calc *= r[i];

        } else {

            printf("-1");

            return 0;

        }

    }

    printf("%lld", calc);

}
// Slower C++ solution:
 #include<bits/stdc++.h>

#include<iostream>

#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

#define ll  long long

#define ull unsigned long long

#define IO ios::sync_with_stdio(false), cin.tie(0)

#define endl '\n'

#define main() int main()

#define ff1(i,n) for(int i=1;i<=n;++i)

#define ff0(i,n) for(int i=0;i<n;++i)

#define pi acos(-1.0)

#define ms(a, x) memset(a, x, sizeof(a))

#define lowbit(x) ((x)&(-(x)))

#define pb push_back

#define binarycount __builtin_popcount(x)

#define tr t[root]

#define lson t[root << 1]

#define rson t[root << 1 | 1]

#define fir first

#define sec second

#define debug(x) cout<<x<<'\n'

#define sa(a) scanf("%d", &a)

#define sab(a, b) scanf("%d%d", &a, &b)

#define pa(a) printf("%d",a)

#define pab(a,b) printf("%d%d",a,b)

#define pii pair<int,int>

using namespace std;



#define maxn 200005

const int inf = 0x3f3f3f3f;

const int mod = 1e9+7;

const double eps = 1e-8;

ll gcd(ll a, ll b) {return b==0?a:gcd(b, a%b);}

ll lcm(ll a, ll b) {return a/gcd(a, b)*b;}

ll powmod(ll a,ll b){

    ll ans = 1, pow = a%mod;

    while(b) { if(b&1) ans = (ans*pow)%mod; pow = (pow*pow)%mod; b >>= 1; }

    return ans%mod;

}

ull a[maxn];

const ll maxx=1e18;

bool flow(ull a, ull b) {

    if (ULLONG_MAX/a<b) {

        return true;

    }

    ull ans = a*b;

    if (ans>maxx) {

        return true;

    }

    return false;

}

main() {

    int n;

    cin>>n;

    int f=1;

    for (int i=0;i<n;i++) {

        cin>>a[i];

        if (a[i]==0) f=0;

    }

    if(f==0){

    	cout<<0<<endl;

    	return 0;

	}

    ll ans=1;

    for (int i=0;i<n;i++) {

        if (flow(ans,a[i])) {

            cout<<"-1"<<endl;

            return 0;

        }

        ans*=a[i];

    }

    cout<<ans<<endl;





}

 

// Faster C++ solution for the same problem (measured speedup: 4.686794602351739x):
#include <stdio.h>



int main() {

    long long int r[100005], n, calc = 1;

    scanf("%lld", &n);

    for (int i = 0; i < n; i++) {

        scanf("%lld", &r[i]);

    }

    for (int i = 0; i < n; i++) {

        if (r[i] == 0) {

            printf("0");

            return 0;

        }

    }

    for (int i = 0; i < n; i++) {

        if (r[i] <= (1000000000000000000 / calc)) {

            calc *= r[i];

        } else {

            printf("-1");

            return 0;

        }

    }

    printf("%lld", calc);

}
// Slower C++ solution:
 #include<bits/stdc++.h>

#include<iostream>

#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

#define ll  long long

#define ull unsigned long long

#define IO ios::sync_with_stdio(false), cin.tie(0)

#define endl '\n'

#define main() int main()

#define ff1(i,n) for(int i=1;i<=n;++i)

#define ff0(i,n) for(int i=0;i<n;++i)

#define pi acos(-1.0)

#define ms(a, x) memset(a, x, sizeof(a))

#define lowbit(x) ((x)&(-(x)))

#define pb push_back

#define binarycount __builtin_popcount(x)

#define tr t[root]

#define lson t[root << 1]

#define rson t[root << 1 | 1]

#define fir first

#define sec second

#define debug(x) cout<<x<<'\n'

#define sa(a) scanf("%d", &a)

#define sab(a, b) scanf("%d%d", &a, &b)

#define pa(a) printf("%d",a)

#define pab(a,b) printf("%d%d",a,b)

#define pii pair<int,int>

using namespace std;



#define maxn 200005

const int inf = 0x3f3f3f3f;

const int mod = 1e9+7;

const double eps = 1e-8;

ll gcd(ll a, ll b) {return b==0?a:gcd(b, a%b);}

ll lcm(ll a, ll b) {return a/gcd(a, b)*b;}

ll powmod(ll a,ll b){

    ll ans = 1, pow = a%mod;

    while(b) { if(b&1) ans = (ans*pow)%mod; pow = (pow*pow)%mod; b >>= 1; }

    return ans%mod;

}

ull a[maxn];

const ll maxx=1e18;

bool flow(ull a, ull b) {

    if (maxx/a<b) {

        return true;

    }



    return false;

}

main() {

    int n;

    cin>>n;

    int f=1;

    for (int i=0;i<n;i++) {

        cin>>a[i];

        if (a[i]==0) f=0;

    }

    if(f==0){

    	cout<<0<<endl;

    	return 0;

	}

    ll ans=1;

    for (int i=0;i<n;i++) {

        if (flow(ans,a[i])) {

            cout<<"-1"<<endl;

            return 0;

        }

        ans*=a[i];

    }

    cout<<ans<<endl;





}

 

// Faster C++ solution for the same problem (measured speedup: 4.686817120233936x):
#include <stdio.h>



int main() {

    long long int r[100005], n, calc = 1;

    scanf("%lld", &n);

    for (int i = 0; i < n; i++) {

        scanf("%lld", &r[i]);

    }

    for (int i = 0; i < n; i++) {

        if (r[i] == 0) {

            printf("0");

            return 0;

        }

    }

    for (int i = 0; i < n; i++) {

        if (r[i] <= (1000000000000000000 / calc)) {

            calc *= r[i];

        } else {

            printf("-1");

            return 0;

        }

    }

    printf("%lld", calc);

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



const int mxn = 1e5;

unsigned long long a[mxn + 11];

const long long mm = 1e18;



int main(){

	int n;

	scanf("%d", &n);

	unsigned long long ans = 1;

	for (int i = 0; i < n; i++){

		scanf("%lld", &a[i]);

	}

	sort(a, a + n);

	if (a[0] == 0LL){

		puts("0");

		return 0;

	}

	for (int i = 0; i < n; i++){

		if (a[i] <= mm / ans)

			ans *= a[i];

		else {

			puts("-1");

			return 0;

		}

	}

	printf("%lld\n", ans);

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 4.624413555956189x):
#include <stdio.h>



int main() {

    long long int r[100005], n, calc = 1;

    scanf("%lld", &n);

    for (int i = 0; i < n; i++) {

        scanf("%lld", &r[i]);

    }

    for (int i = 0; i < n; i++) {

        if (r[i] == 0) {

            printf("0");

            return 0;

        }

    }

    for (int i = 0; i < n; i++) {

        if (r[i] <= (1000000000000000000 / calc)) {

            calc *= r[i];

        } else {

            printf("-1");

            return 0;

        }

    }

    printf("%lld", calc);

}
// Slower C++ solution:
#include <iostream>





#define endl '\n'

#define pi acos(-1)

#define euler_e 2.71828

#define pii pair<int,int>

#define pb push_back

#define all(a) a.begin(),a.end()

#define ll long long

#define ull unsigned long long

#define io freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

#define boost ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

using namespace std;

void mycode();

const ll int mod=998244353;

ll int ceil(ll int a,ll int b){return (a+b-1)/b;}

ll int min(ll int a, ll int b){if(a>b)return b;else return a;}

bool bit_check(ll int a,int i){

  if((a & (1LL<<i)))return 1;

  return 0;

}

ll int bit_toggle(ll int a,int i){

  return (a^(1LL<<i));

}

ll int bit_sum(ll int a,int i){

  return a+(1LL<<i);

}

ll int bit_sub(ll int a,int i){

  return a-(1LL<<i);

}

ll int mod_power(ll int x,ll int y){//x^y%p

  ll int p=mod;

  ll int res = 1;

  x = x % p;

  while (y > 0) { 

    if (y & 1)res = (res*x) % p;

    y = y>>1;x = (x*x) % p;

  }

  return res;

}

ll int power_of(ll int a,int b){

  if(a==0)return -1;

  return 1+power_of(a/b,b);

}

ll int power(ll int a, ll int b) {

	if(a==1)return 1;

    ll int res = 1;

    while (b > 0) {

        if (b & 1)

            res = res * a;

        a = a * a;

        b >>= 1;

    }

    return res;

}

//__int128

int main(){

	//boost;

	//io;

	//auto start = chrono::high_resolution_clock::now();

	mycode();

	//auto end = chrono::high_resolution_clock::now();cerr << "\nExecution time: "<< chrono::duration_cast<chrono::milliseconds>(end - start).count() << " ms" << endl;

	return 0;

}



void mycode(){

	int t;

	cin>>t;

	ull int arr[100005];

	bool flag1=0,flag2=0;

	for(int i=0;i<t;i++){cin>>arr[i];if(arr[i]==0)flag1=1;}

	if(flag1)cout<<0;

	else{

		__int128 k=1;

		for(int i=0;i<t;i++){

			k*=arr[i];

			//cout<<(ll)k<<endl;

			if(k>1000000000000000000){flag2=1;break;}

		}

		if(flag2)cout<<-1;

		else cout<<(ull)k<<endl;

	}

}

// Faster C++ solution for the same problem (measured speedup: 4.758445925154105x):
#include <stdio.h>



int main() {

    long long int r[100005], n, calc = 1;

    scanf("%lld", &n);

    for (int i = 0; i < n; i++) {

        scanf("%lld", &r[i]);

    }

    for (int i = 0; i < n; i++) {

        if (r[i] == 0) {

            printf("0");

            return 0;

        }

    }

    for (int i = 0; i < n; i++) {

        if (r[i] <= (1000000000000000000 / calc)) {

            calc *= r[i];

        } else {

            printf("-1");

            return 0;

        }

    }

    printf("%lld", calc);

}
// Slower C++ solution:
#include<bits/stdc++.h>

#define ll long long

using namespace std;

int main()

{

  ll n,i,j,sum,flg=0,cnt=0,c=1000000000000000000;

  cin>>n;

  ll ar[n+1];

  for(i=0;i<n;i++)

  {

      cin>>ar[i];

      if(ar[i]==0)

        cnt=1;

  }

  sum=ar[0];

  if(cnt==1)

    cout<<0<<endl;

  else

  {

      for(i=1;i<n;i++)

      {

          if(ar[i]<=c/sum)

            sum=sum*ar[i];

          else

          {

              flg=1;

              break;

          }

      }

      if(flg==1)

        cout<<-1<<endl;

      else

        cout<<sum<<endl;

  }



}


// Faster C++ solution for the same problem (measured speedup: 4.6800748438581x):
#include <stdio.h>



int main() {

    long long int r[100005], n, calc = 1;

    scanf("%lld", &n);

    for (int i = 0; i < n; i++) {

        scanf("%lld", &r[i]);

    }

    for (int i = 0; i < n; i++) {

        if (r[i] == 0) {

            printf("0");

            return 0;

        }

    }

    for (int i = 0; i < n; i++) {

        if (r[i] <= (1000000000000000000 / calc)) {

            calc *= r[i];

        } else {

            printf("-1");

            return 0;

        }

    }

    printf("%lld", calc);

}
// Slower C++ solution:


#include <bits/stdc++.h>

using namespace std;

 

const int MAXN = 2e5+2;

unsigned long long nums[MAXN];

 

const long long MAXL = 1e18;

 

//判断a*b是否超过1e18

bool overflow(unsigned long long a, unsigned long long b) {

    //判断是否越界

    if (ULLONG_MAX / a < b) {

        return true;

    }

    //判断是否超过1e18

    unsigned long long ans = a*b;

    if (ans>MAXL) {

        return true;

    }

    return false;

}

 

int main() {

    int n;

    scanf("%d", &n);

    for (int i=0; i<n; i++) {

        scanf("%llu", &nums[i]);

        if (0==nums[i]) {

            printf("0\n");

            return 0;

        }

    }

 

    long long ans=1;

    for (int i=0; i<n; i++) {

        if (true == overflow(ans, nums[i])) {

            printf("-1\n");

            return 0;

        }

        ans *= nums[i];

    }// 

    printf("%llu", ans); 

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.971851557145659x):
#include <stdio.h>



int main(){

	long long int n;

	scanf("%lld",&n);

	long long int num[n]={};

	long long int res=1;

	long long int temp;

	for (long long int i=0;i<n;i++){

		scanf("%lld",&num[i]);

	}

	for(long long int i=0;i<n;i++){

	

		if (num[i]==0){

			printf("0\n");

			return 0;

		}

		}

	for (int i=0;i<n;i++){

		if(num[i]<=1000000000000000000/res){

			res*=num[i];

		}

		else{

			printf("-1\n");

			return 0;

		}

	}	

		printf("%lld",res);

		return 0;

	}