#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-7;
int main() {
  int n, a[100];
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  sort(a, a + n);
  n = unique(a, a + n) - a;
  if (n <= 1) {
    cout << "NO";
  } else {
    cout << a[1] << endl;
  }
  return 0;
}
