#include<bits/stdc++.h>
using namespace std;
bool palindrome(int a[],int n,int i,int j){
if(n==1 || n==0){
return true;
}
else if( a[i]==a[j] && palindrome(a,n,i+1,j-1))
{
return true;
}
else
return false;
}
int main(){
int n;
cin>>n;
int a[n]={0};
for(int i=0;i<n;i++){
cin>>a[i];
}
if(palindrome(a,n,0,n-1))
cout<<“true”;
else
cout<<“false”;
return 0;
}