#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
int n, arr[maxn];
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n; i++) {
      scanf("%d", &arr[i]);
    }
    sort(arr + 1, arr + 1 + n);
    int Min = arr[1];
    int pos = 1;
    while (arr[pos] == Min) {
      pos++;
    }
    if (pos > n) {
      puts("NO");
    } else {
      printf("%d\n", arr[pos]);
    }
  }
  return 0;
}
