#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, arr[105], x, i, mx = 200, flag = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] < mx) mx = arr[i];
  }
  sort(arr, arr + n);
  for (i = 0; i < n; i++) {
    if (arr[i] > mx) {
      x = arr[i];
      flag = 1;
      break;
    }
  }
  if (n == 1 || flag == 0) {
    cout << "NO" << endl;
    return 0;
  }
  cout << x << endl;
  return 0;
}
