Javascript - DP
Code\n\n/**\n * @param {string} binary\n * @return {number}\n */\nvar numberOfUniqueGoodSubsequences = function (binary) {\n  let countZero = 0;\n  let endsOne 
# Code\n```\n/**\n * @param {string} binary\n * @return {number}\n */\nvar numberOfUniqueGoodSubsequences = function (binary) {\n  let countZero = 0;\n  let endsOne = 0;\n  let endsZero = 0;\n  const MOD = 10 ** 9 + 7;\n\n  for (const char of binary) {\n    if (char === \'1\') {\n      endsOne = (endsOne + endsZero + 1) % MOD;\n    } else {\n      endsZero = (endsOne + endsZero) % MOD;\n      countZero = 1;\n    }\n  }\n\n  return (endsOne + endsZero + countZero) % MOD;\n};\n\n```
['Dynamic Programming', 'JavaScript']