#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
constexpr int INF = (int)1e9;
constexpr long long LINF = (long long)1e18;
//constexpr long long MOD = 1e9 + 7;
constexpr long long MOD = 998244353;
constexpr double pi = 3.141592653589793238;

int main() {
    int n;
    cin >> n;

    set<int> ans;
    for (int i = 0; i < n; ++i) {
        int a;
        cin >> a;
        if (ans.count(a)) {
            cout << "No" << endl;
            return 0;
        }
        else {
            ans.insert(a);
        }
    }

    cout << "Yes" << endl;

    return 0;
}
#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
 
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
 
#define rep(i,cc,n) for(int i=cc;i<n;++i)
#define lrep(i,cc,n) for(long long i=cc;i<n;++i)
#define sqrep(i,cc,n) for(long long i=cc;i*i<=n;++i)
#define rrep(i,cc,n) for(long i=cc;i>n;--i)
#define pii pair<int, int>
#define pll pair<long long, long long>
 
using ll = long long;
//using mint = modint;
 
const vector<int> dx = {1, 1,  1, 0,  0, 0, -1, -1, -1};
const vector<int> dy = {1, 0, -1, 1, -1, 0,  1,  0, -1};
const double PI = 3.141592653589793;
const ll inf = 1001001001;
const ll e9  = 1000000000;
const ll mod = 1000000007;
const ll mod2 = 998244353;
 
const int MAX = 1000000;
const ll MOD = 998244353;
const ll big = 1ll<<60;
 
ll gcd(ll x, ll y) { return (x % y)? gcd(y, x % y): y; }

int main(){
   int n;
   cin >> n;
   vector<int>a(n), b(n);
   rep(i, 0, n){
       cin >> a[i];
       a[i]--;
       b[i] = i;
   }
   sort(a.begin(),a.end());
   if(a==b){
       cout << "Yes" << endl;
   }else{
       cout << "No" << endl;
   }
   return 0;
}