Write a function to check if a given positive integer is a power of 2. Do not use loops, multiplication, division, or library functions.You must solve it using bitwise logic only.
Example-1
Input: n = 8 Output: YES
Example-2
Input: n = 7 Output: NO
Example-3
Input: n = 1 Output: YES
Test Cases
Test Results
Input
8
Expected Output
YES