Checking if the difference of non - zero oddbits and evenbits is divisible by 3.
if ( Math . abs ( oddbits - evenbits ) % 3 == 0 ) { System . out . print ( " Yes " + "NEW_LINE"); } else { System . out . print ( " No " + "NEW_LINE"); } }