OI-Codes/atcoder/abc390/B_Geometric_Sequence.cpp
2025-04-19 10:09:06 +08:00

33 lines
493 B
C++

#include <bits/stdc++.h>
#define lo long long
#define INF INT_MAX
#define LLM LONG_LONG_MAX
using namespace std;
const lo N = 1e7 + 10;
/*
toothless. #17
@fredcss_dev
*/
lo n;
lo a[N], b;
bool flag = 0;
signed main()
{
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
for (int i = 3; i <= n; i++)
{
if (a[i] * a[1] != a[i - 1] * a[2])
{
puts("No");
return 0;
}
}
puts("Yes");
return 0;
}