# Codeforces849a odds and ends

Posted by yjjr's blog on February 6, 2018

Where do odds begin, and where do they end?Where does hope emerge, and will they ever break?

Given an integer sequencea1, a2, ..., an of lengthn. Decide whether it is possible to divide it intoan odd number of non-empty subsegments, the each of which has an odd length andbegins and ends with odd numbers.

A subsegment is a contiguous slice of thewhole sequence. For example, {3, 4, 5} and {1} are subsegments of sequence {1, 2, 3, 4, 5, 6}, while {1, 2, 4} and {7} are not.

Input

The first line of input contains anon-negative integern (1 ≤ n ≤ 100) — the length of the sequence.

The second line containsn space-separatednon-negative integersa1, a2, ..., an (0 ≤ ai ≤ 100) — the elementsof the sequence.

Output

Output "Yes" if it's possible tofulfill the requirements, and "No" otherwise.

You can output each letter in any case(upper or lower).

Example

Input

3
1 3 5

Output

Yes

Input

5
1 0 1 5 1

Output

Yes

Input

3
4 3 1

Output

No

Input

4
3 9 9 3

Output

No

Note

In the first example, divide the sequenceinto 1 subsegment: {1, 3, 5} and therequirements will be met.

In the second example, divide the sequenceinto 3 subsegments: {1, 0, 1}, {5}, {1}.

In the third example, one of thesubsegments must start with 4 which is an even number, thus the requirementscannot be met.

In the fourth example, the sequence can bedivided into 2 subsegments: {3, 9, 9}, {3}, but this is not a valid solution because 2 is an evennumber.

#include<bits/stdc++.h>
{
int f=1,x=0;char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
return x*f;
}
int n,ans=0,flag;
int a[105];

void work(int l,int r)
{
if(a[l]%2==0){flag=0;return;}
int i;
ans++;//printf("%d %d %d\n",l,r,ans);
for(i=r;i>=l;i--)
if((i-l)%2==0&&a[i]%2!=0){break;}
if(i<r)work(i+1,r);
}
int main()
{
for(int i=1;i<105;i++)a[i]=2;
}
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5321356654167175, "perplexity": 3214.1451688442685}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-09/segments/1550247500089.84/warc/CC-MAIN-20190221051342-20190221073342-00023.warc.gz"}