#pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include using namespace std; #define rep(i,n) for(ll i=0;i=l;i--) using ll = long long; using ld = long double; constexpr ll mod = 998244353ll; #define vout(v) for(auto i :v) cout< #define pb push_back #define vc vector #define vb vector #define uniq(x) sort((x).begin(),(x).end());(x).erase(unique((x).begin(),(x).end()),(x).end()) #define eb emplace_back void no(void) { cout<<"No"< dx={-1,0,1,0,1,1,-1,-1}; vector dy={0,-1,0,1,-1,1,-1,1}; bool isin(ll i,ll j,ll h,ll w) { if(i<0 || i>=h || j<0 || j>=w) return false; return true; } template bool chmin(T& a, T b){if(a > b){a = b; return true;} return false;} template bool chmax(T& a, T b){if(a < b){a = b; return true;} return false;} templateT vecmax(const vector&v){return *max_element(all(v));} templateT vecmin(const vector&v){return *min_element(all(v));} ll safemod(ll num,ll rule) { return (num%rule+rule)%rule; } //alias ojb='oj-bundle -I /home/leal/beginner/atc/library' int main() { ll n; cin>>n; vl a(n+1); rep(i,n) cin>>a[i+1]; //f(0)=-1<0 ll high=0; ll rem; srep(i,1,n) { if(a[i]!=0) { chmax(high,n+1-i); rem=i; break; } } if(high==0) { no(); return 0; } if(a[rem]>0) { yes(); return 0; } else { if(high%2==1) yes(); else no(); } }