Var
a:array[1..1000] of longint;
n,i,k:longint;
begin
readln(n);
for i:=1 to n do read(a[i]);
if odd(a[1]) then k:=1 else k:=2;
for i:=2 to n do
begin
if (odd(a[i]))and(k=1) then
begin
writeln('No');
halt;
end;
if (not odd(a[i]))and(k=2) then
begin
writeln('No');
halt;
end;
if k=1 then k:=2 else k:=1;
end;
writeln('Yes');
end.