**PROBLEM LINK**

Practice

Contest

Author: Aman Kumar Singh

Tester: Avijit Agarwal, Sarthak Manna

Editorailist: Souradeep Paul

**DIFFICULTY**

Cakewalk

**PREREQUISITES**

Basic Math

**PROBLEM**

Given N numbers, find if there exists an odd integer x such that x is divisible by all N numbers. If yes, then print “**YES**”, otherwise “**NO**”.

**EXPLANATION**

It’s obvious that if x is an odd integer then all N numbers should be odd. If at least one number is even then no such x will exist as no odd number is divisible by an even number. So if all numbers are odd then the answer will be “**YES**”, otherwise “**NO**”.

The time complexity is \mathcal{O}(N).

**SOLUTIONS**

C++ solution can be found here

Java solution can be found here

Python solution can be found here