#include <bits/stdc++.h>
using namespace std;
int a[101], b[101] = {0};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, c = 0;
  cin >> n;
  ;
  for (int i = 1; i <= n; i++) cin >> a[i];
  ;
  if (n == 1) {
    cout << "NO" << endl;
    return 0;
  }
  sort(a + 1, a + n + 1);
  int mn = a[1];
  for (int i = 1; i <= n; i++)
    if (a[i] == mn) a[i] = 101;
  sort(a + 1, a + n + 1);
  int ch = 0;
  for (int i = 1; i <= n; i++)
    if (a[i] == 101) ch++;
  if (ch == n) {
    cout << "NO" << endl;
    return 0;
  }
  cout << a[1] << endl;
  ;
  return 0;
  ;
}
