#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main() {
  int n,tmp;
  cin >> n;
  int a[110];
  for(int i = 0; i < n; i++){
    cin >> a[i];
  }
  for(int i = n-1; i >= 0;i--){
    cout << a[i];
    if(i != 0){
      cout << " ";
    }
  }
  /*ソートじゃなかった！
  for(int i = 0;i < n-1; i++){
    for(int j = n-1;j > i;j--){
      if(a[j-1] < a[j]){
        tmp = a[j-1];
        a[j-1] = a[j];
        a[j] = tmp;
      }
    }
  }
  for(int i = 0;i < n; i++){
    cout << a[i];
    if(i != n-1){
      cout << " ";
    }
  }
  */
  cout << endl;
  return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define f first
#define s second
#define ins insert
#define eb emplace_back
#define endl '\n'
#define ll long long
#define ld long double
#define vl vector<ll>
#define tc ll t; cin >> t; while (t--)
#define yes cout << "Yes" << endl
#define no cout << "No" << endl
#define sz(c) (ll) c.size()
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define trav(x,c) for(auto &x : c)
#define _for(i,a,n) for(ll i = a ; i < n ; ++i)
#define _rfor(i,a,n) for(ll i = n-1 ; i >= a ; --i)
#define dx(x) cout << #x << ": " << x << endl;
#define dc(c) trav(x,c) cout << x << " "; cout << endl;
#define godspeed ios::sync_with_stdio(0); cin.tie(0);

int main() {
    godspeed;
    set<int> s;
    int x;
    while(cin >> x) {
        s.ins(x);
    }

    if(sz(s) == 2) yes;
    else no;
}