Traverse the array
for ( int i = 0 ; i < N ; i ++ ) { sum += arr [ i ] ; } if ( sum == 0 ) System . out . print ( " Yes " ) ; else if ( sum > 0 ) { if ( sum % K == 0 ) System . out . print ( " Yes " ) ; else System . out . print ( " No " ) ; } else System . out . print ( " No " ) ; return 0 ; }