DP
\nclass Solution:\n    def numberOfUniqueGoodSubsequences(self, binary: str) -> int:\n        dp, has_0, mod = [0, 0], 0, 10**9+7\n        for char in binary:\n
```\nclass Solution:\n    def numberOfUniqueGoodSubsequences(self, binary: str) -> int:\n        dp, has_0, mod = [0, 0], 0, 10**9+7\n        for char in binary:\n            if char == \'0\':\n                has_0 = 1\n                new_val = sum(dp)\n                dp[0] = new_val\n            else:\n                new_val = sum(dp) + 1\n                dp[1] = new_val\n        return (sum(dp) + has_0) % mod     \n```
['Python3']