Just iterate through [2,4,8] in this order as i , and see if n \pmod i=0
Complexity O(1)
n=int(input()) for i in [2,4,8]: if(n%i==0): print("Yes") else: print("No")