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