#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[101];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a + n);
  int i = 1;
  while (a[i] == a[i - 1] && i < n) i++;
  if (i == n)
    printf("NO\n");
  else
    printf("%d\n", a[i]);
  return 0;
}
