As a newbie programmer

Special Array @ Dcoder

Dcoder icon

Problem: Natural numbers are the set of positive integers, which ranges from 1 to infinity excluding fractional part. Natural numbers are whole numbers excluding zero. Zero is the only whole number which is not a natural number. An array is special if all the elements are natural numbers. Find whether the given array is special or not.

Input: The first line of input contains a single integer N denoting the array size.

 The second line of input contains N-space separated integers denoting the array.

Output: Print "Yes" if the array is special else print "No".

Constraints: 1<=N<=100.

0<=Arrays elements<=100.

Sample Input: 4

0 1 2 3

Sample Output: 

No

input()
print('No' if '0' in input().split() else 'Yes')

How do you rate this article?

0


Lochard
Lochard

20240228 Arrived in the UK for about 2 week. All my fears persist. Some are even getting worse. https://github.com/locharp/asylum_diary/


As a newbie programmer
As a newbie programmer

Sharing entry level codes. My snippets on GitHub https://github.com/locharp/code-snippets

Publish0x Publish0x

Reward the author with $0.01 in crypto, and earn yourself as you read!

20% to author / 80% to me.
Rewards are FREE. Publish0x pays them, not you.

Page not displaying correctly?