#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, arr[102];
  cin >> n;
  if (n == 1) {
    int x;
    cin >> x;
    cout << "NO\n";
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  for (int i = 0; i < n - 1; ++i) {
    int j = i + 1;
    if (arr[j] != arr[i]) {
      cout << arr[j] << endl;
      return 0;
    }
  }
  cout << "NO\n";
  return 0;
}
