object Solution {

  def evenSubsets(even: Int, odd: Int) = {
    val p =1e9.toInt + 7
    (BigInt(2).modPow(even + math.max(0, odd - 1), p) - 1) % p
  }

  def main(args: Array[String]) {
    val _ = readLine
    val nums = readLine.split(" ").map(_.toInt)
    val even = nums.filter(_ % 2  == 0).size
    val odd = nums.size - even
    println(evenSubsets(even, odd))
  }
}

Add solution to problem A Chocolate Fiesta. The number of even non-empty subsets equals pow(2, numOfEven + max(numOfOdd - 1, 0)).
Add solution to problem A Chocolate Fiesta. The number of even non-empty subsets
equals pow(2, numOfEven + max(numOfOdd - 1, 0)).
