diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -14,8 +14,7 @@
 for i in range(n):
     inv = pow(a[i], -1, MOD)
     for bit in range(1 << 10):
-        if dp[i][bit] == 0:
-            continue
+        dp[i + 1][bit] += dp[i][bit] * max(0, a[i] - 10) * inv
         for plus in range(1, min(11, a[i] + 1)):
             nex = (bit * (2**plus) + 2 ** (plus - 1)) % (1 << 10)
             dp[i + 1][bit | nex] += dp[i][bit] * inv
