#include using namespace std; using pii=pair; using i64=int_fast64_t; int n; i64 hei[1<<17]; i64 hsum[1<<17]; const i64 inf=1e18; //for [l,r] i64 calc(int l,int r) { return hei[r+1]-hei[l]; } int main() { cin>>n; for(int i=0; i>hei[i]; sort(hei,hei+n); if(hei[0]==hei[n-1]) { cout<<1<