传送门
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define re register
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define P pair<int,int>
const int N=1e4;
const int mod=1e9+;
void read(int &a)
{
a=;
int d=;
char ch;
while(ch=getchar(),ch>''||ch<'')
if(ch=='-')
d=-;
a=ch-'';
while(ch=getchar(),ch>=''&&ch<='')
a=a*+ch-'';
a*=d;
}
void write(int x)
{
if(x<)
putchar(),x=-x;
if(x>)
write(x/);
putchar(x%+'');
}
int a[];
int main()
{
int n;
read(n);
int cur;
for(re int i=;i<=n;i++)
read(a[i]);
int t1=,t2=;
for(re int i=;i<=n;i++)
{
if(a[i]==)
break;
t1++;
}
for(re int i=n;i>=;i--)
{
if(a[i]==)
break;
t2++;
}
if(t1&||t2&)
puts("YES");
else
puts("NO");
return ;
}