#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define all(x) x.begin(),x.end()
signed main(){
	int n,k; cin>>n>>k;
	vector<int>v(n+5);
	int mn=INT_MAX,mx=INT_MIN;
	for(int i=0;i<n;i++){
		cin>>v[i];
		mn=min(mn,v[i]);
		mx=max(mx,v[i]);
	}
	if(mn!=mx){
		cout<<1;
	}else{
          while(true) cout<<1;
         } 
	
}