#include <bits/stdc++.h>
using namespace std;
int a[100];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, flag = 0;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  int minimum = a[0];
  for (int i = 0; i < n; i++) {
    if (a[i] > minimum) {
      cout << a[i] << "\n";
      flag = 1;
      break;
    }
  }
  if (flag == 0)
    cout << "NO"
         << "\n";
  return 0;
}
