JavaScript Solution
javascript\nconst MOD = 1000000007;\n\nvar numberOfUniqueGoodSubsequences = function(binary) {\n    let endsZero = 0;\n    let endsOne = 0;\n    let hasZero = 0
```javascript\nconst MOD = 1000000007;\n\nvar numberOfUniqueGoodSubsequences = function(binary) {\n    let endsZero = 0;\n    let endsOne = 0;\n    let hasZero = 0;\n    for (let i = 0; i < binary.length; i++) {\n        if (binary[i] === \'1\') {\n            endsOne = (endsZero + endsOne + 1) % MOD;\n        } else {\n            endsZero = (endsZero + endsOne) % MOD;\n            hasZero = 1;\n        }\n    }\n    return (endsZero + endsOne + hasZero) % MOD;\n};\n```
['JavaScript']