OI-Codes/atcoder/abc395/A_Strictly_Increasing.cpp
Frederick Chen c2e6cadefa AtCoder Beginner Contest 395
https://atcoder.jp/contests/abc395

Signed-off-by: Frederick Chen <seventeen@ohdragonboi.cn>
2025-04-19 10:11:24 +08:00

37 lines
636 B
C++

#include <bits/stdc++.h>
#define lo long long
#define INF INT_MAX
#define LLM LONG_LONG_MAX
#define endl "\n"
using namespace std;
/*
toothless. #17
@fredcss_dev
*/
int n, a[1000005], b[1000005];
bool f[100000005];
signed main()
{
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
b[i] = a[i];
if (!f[a[i]]) f[a[i]] = 1;
else {
cout << "No";
return 0;
}
}
sort(a + 1, a + 1 + n);
for (int i = 1; i <= n; i++) {
if (a[i] != b[i]) {
cout << "No";
return 0;
}
}
cout << "Yes";
return 0;
}