#include <bits/stdc++.h>
int comp(const void *a, const void *b) { return *(int *)a - *(int *)b; }
int main() {
  int area[100];
  int code;
  int judge;
  scanf("%d", &code);
  for (int i = 1; i <= code; i++) {
    scanf("%d", &area[i]);
  }
  qsort(&area[1], code, sizeof(area[1]), comp);
  judge = area[1];
  for (int i = 1; i <= code; i++) {
    if (area[i] != judge) {
      printf("%d\n", area[i]);
      return 0;
    } else
      ;
  }
  printf("NO\n");
  return 0;
}
