For this Question: Siddharth, a great entrepreneur, chooses a person as an intern if he/she good at maths. Thus Sid gives a simple maths problem to the candidate based on which he decides to who is gonna get the offer. Below is the description of the problem asked by Sid
Given arr <b>A[]</b> containing <b>N</b> positive integers. The task is to check whether it is possible to divide the given array into an <b>odd number of non-empty subarrays each of odd length such that each sub-array starts and ends with an odd number</b>. If it is possible to divide the array then print "<b>YES</b>" otherwise "<b>NO</b>".

<b>Note:</b> Don't forget that the complete array is also considered as a subarrayThe first line of each test case contains N size of array. Second-line contains N space-separated elements.

<b>Constraints:</b>
1 <= N <= 999999
0 <= A[i] <= 999999999Print "YES", if it is possible to divide the array. Otherwise, print "NO". Without quotes.Sample Input 1:
5
9 0 3 1 5

Sample Output 1:
YES

Sample Input 2:
3
1 2 0

Sample Output 2:
NO

Explanation:
Testcase 1: Array {9, 0, 3, 1, 5} can be divided as {9, 0, 3}, {1}, {5}., I have written this Solution Code: 
def fun(n,arr):
    if n%2==0:
        if arr[0]%2==1 and arr[n-1]%2==1:
            for i in range(1,n):
                if arr[i]%2==1 and arr[i-1]%2==1:
                    return "YES"
        else:
            return "NO"

    else:
        
        if arr[0]%2==1 and arr[n-1]%2==1:
            return "YES"
        else:
            return "NO"

n=int(input())
arr=[int(i) for i in input().split()]
print(fun(n,arr)), In this Programming Language: Python, Now tell me if this Code is compilable or not?