题目链接:https://codeforces.com/contest/22/problem/A
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> v;
int n;
int main()
{
scanf("%d",&n);
for(int i=0;i<n;i++)
{
int x;
scanf("%d",&x);
v.push_back(x);
}
sort(v.begin(),v.end());
v.erase(unique(v.begin(),v.end()),v.end());
if(v.size()<2) puts("NO");
else printf("%d\n",v[1]);
return 0;
}