WA一个,hack数据WA3个
#include <bits/stdc++.h>
using namespace std;
#define sp putchar(' ')
#define en putchar('\n')
#define pb push_back
#define int long long
#define HP 1000000000000002097
#define umap unordered_map
int read(){ char ch=getchar();int x=0,f=1;while(ch>'9' || ch<'0'){if(ch=='-') f=-1;ch=getchar();}while(ch>='0' && ch<='9')x=(x<<1)+(x<<3)+(ch^48),ch=getchar();return x*f; }
void print(int x){ if(x<0) putchar('-'),x=-x;if(x>9)print(x/10);putchar(x%10+'0'); }
const int N=2e5+5,P=998244353;
int n;
double a[N];
signed main()
{
ios::sync_with_stdio(0);cin.tie(0),cout.tie(0);
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i];
}
for(int i=1;i<n-1;i++){
if(a[i+1]*a[i+1]!=a[i+2]*a[i]) return cout<<"No",0;
}
cout<<"Yes";
return 0;
}