#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <set>
#include <queue>
#include <cmath>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
using P = pair<int,int>;
#define INF 1001001001
#define LINF (1LL<<60)
#define F first
#define S second
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; }

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  sort(all(a));
  bool ans = true;
  rep(i, n) {
    if (a[i] != i+1) ans = false;
  }
  if (ans) puts("Yes");
  else puts("No");
}

/**
 * \author KienNguyen246
 * \date 01/06/2021
 */

///😭😢😞☹🙁😐🙂☺😊😁😀😆😂🤣

///----------------🤔🤔🤔 -----------------///

/**< 🤣🤣🤣 */
#include <bits/stdc++.h>

///TLE (in case of emergency)
#define TLE 0
#if TLE
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#endif // TLE

#define NOT_INTERACTIVE 1

using namespace std;

typedef long long ll;
//typedef double db;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;

//const int maxn = 5005;
const int maxn = 5e5 + 7;
const int mod =  1e9 + 7;
const int infi = (2e9 + 69);
const ll infy = (2e16 + 69);
const int base = 311;
const ll MM = 7ll * mod * mod;
const int addition = 1e5;
const double eps = 1e-8;
const string numd[10] = {"1110111", "0010010", "1011101", "1011011", "0111010", "1101011", "1101111", "1010010", "1111111", "1111011"};
const int dx[4] = {1, -1, 0, 0};
const int dy[4] = {0, 0, 1, -1};
const double pi = 3.14159265358980;
const string P1 = "ALICE";
const string P2 = "BOB";
const string spmcode = "My power does not end. Ask for aid and you will receive it.\n";

template <typename Num> void maximize (Num &x, Num y) {x = mx (x, y);}
template <typename Num> void minimize (Num &x, Num y) {x = min (x, y);}
void exit_with_runtime() {double x = 1.0 * clock() / CLOCKS_PER_SEC; cerr << "\n\n---------------------\nTime elapsed: " << x << " s.\n\n"; exit (0);}
void decorate() {cerr << "KienNguyen246\n"; chrono:: system_clock::time_point today = chrono::system_clock::now(); time_t tt = chrono::system_clock::to_time_t (today); cerr << ctime (&tt); cerr << "\nProcessing...\n\n";}

///Multiple tests?
#define MUL_TEST 0

/**< 🤣🤣🤣 */

//bool Palin(string s) {string r = s; reverse(whole(r)); return (r == s);}

/* 🙃🙃🙃 */
int n, a[maxn], cnt[maxn];

//My power does not end. Ask for aid and you will receive it.
void Main_Process()
{
    cin >> n;
    for (int i = 1; i <= n; i ++)
    {
        cin >> a[i];
        cnt[a[i]] ++;
        if (cnt[a[i]] == 2)
        {
            cout << "No";
            return;
        }
    }
    cout << "Yes";

}

/**< 😂😂😂 */
int main()
{
    /**< Main preprocessing begin */
    ios_base::sync_with_stdio (0);

#if NOT_INTERACTIVE
    cin.tie(0); cout.tie(0);
    decorate();

#ifndef ONLINE_JUDGE
    freopen(".inp", "r", stdin);
//    freopen(".out", "w", stdout);
#endif
#endif
    /**< Main preprocessing end */
    /*😍😍😍*/
    int test = 1;

//    Prepare();

#if MUL_TEST
    cin >> test;
#endif

    while (test --)
    {
        Main_Process();
    }
    exit_with_runtime();
}
/**< 😂😂😂 */
///😂😂😂😂😂😂😂😂🌚🔥😂😂😂😂🌚🔥😂😂🔥😂😂😂🔥😂😂😂🔥😂💯💯💯💯💩🐸🔥😂🔥😂🔥💩🔥🔥😂🌚💯🐸💯💩🐸🔥🔥💞🔥💩💩💩💞😂😂😂😂😂😂😂💞💞😂😂😂💞🔥🔥💞💯💩💞💯💞😂😂😂💞💩💩💩💩💩💩💞💩💩💩💩💩💩💩💩💞🔥🔥😂💞🔥😂😂💞
