You are given an integer input N and you have to find whether it is the sum or the difference of the integer 5. (5+5, 5+5+5, 5-5,5-5-5+5+5…..)
 
Example 1:
Input:
N = 10
Output:
YES
Explanation:
Because 10 can be 
written as a sum of 5+5.
 
 
Example 2:
Input:
N = 9
Output:
NO
Explanation:
9 can not be written
in the above form.
 
 
Your Task:
You don't need to read input or print anything. Your task is to complete the function isValid() which takes an integer N and returns "YES" or "NO".
 
Expected Time Complexity: O(1)
Expected Auxiliary Space: O(1)
 
Constraints:
-10^{9}<=N<=10^{9}

Source: geeksforgeeks | Difficulty: EASY
Tags: Mathematics

Starter code: #User function Template for python3
class Solution:
    def isValid (self,N):
        # code here 

Solutions:
class Solution:

	def isValid(self, N):
		if N % 5 == 0:
			return 'YES'
		else:
			return 'NO'


class Solution:

	def isValid(self, N):
		b = 'NO'
		if N % 5 == 0:
			a = 'YES'
			return a
		return b


class Solution:

	def isValid(self, N):
		return ['NO', 'YES'][not N % 5]


class Solution:

	def isValid(self, N):
		if N % 10 in [5, 0]:
			return 'YES'
		return 'NO'


class Solution:

	def isValid(self, N):
		m = 10 ** 9 + 1
		if N in range(-m, m):
			if N % 5 == 0:
				return 'YES'
			elif N % 5 != 0:
				return 'NO'