#include <iostream>
#include <vector>
using namespace std;

int main() {
  int n;
  cin >> n;
  
  vector<int> v(n);
  for(auto& nx : v) {
    cin >> nx;
  }
  
  bool b = 0;
  for(int i = 0; i < n; ++i) {
    for(int j = i + 1; j < n; ++j) {
      if(v[i] == v[j]) {
        cout << "No" << endl;
        b = 1;
        break;
      }
    }
    if(b == 1) break;
  }
  
  if(b == 0) {
    cout << "Yes" << endl;
  }
  
  return 0;
}
// #include <atcoder/all>
#include <bits/stdc++.h>

#ifndef M_PI
#define M_PI 3.14159265358979
#endif
#define deg_to_rad(deg) (((deg) / 360) * 2 * M_PI)
#define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360)

#define rep2(i, m, n) for(long long i = (m); i < (n); ++i)
#define rep(i, n) rep2(i, 0, n)
#define drep2(i, m, n) for(long long i = (m)-1; i >= (n); --i)
#define drep(i, n) drep2(i, n, 0)
#define all(x) (x).begin(), (x).end()

using namespace std;
// using namespace atcoder;

typedef long long ll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef pair<ll, ll> pll;
typedef pair<int, int> pi;
typedef long double ld;
typedef pair<long double, long double> pld;

template <class T> bool chmax(T &a, const T &b) {
    if(a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T> bool chmin(T &a, const T &b) {
    if(b < a) {
        a = b;
        return 1;
    }
    return 0;
}

const ll INF = 1e18;
const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    ll N;
    cin >> N;
    vll A(N);
    for(auto &e : A)
        cin >> e;
    vll P(N, 0);
    rep(i, N) {
        ll a = --A[i];
        P[a]++;
    }
    ll ok = 1;
    rep(i, N) {
        if(P[i] != 1)
            ok = 0;
    }
    if(ok == 1) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}