class Solution:
    def numSub(self, s: str) -> int:
        s_list = s.split("0")
        ans_map = {}
        res = 0
        for i in s_list:
            n = len(i)
            if n in ans_map:
                res += ans_map[n]
            else:
                ans = (1+n)*n//2
                res += ans
                ans_map[n] = ans
        return res % (10**9 + 7)

print(Solution().numSub("111111"))
0758deaf194a1db873a70bfd535289ddca751f59
<mask token>

class Solution:
    <mask token>


<mask token>

class Solution:

    def numSub(self, s: str) ->int:
        s_list = s.split('0')
        ans_map = {}
        res = 0
        for i in s_list:
            n = len(i)
            if n in ans_map:
                res += ans_map[n]
            else:
                ans = (1 + n) * n // 2
                res += ans
                ans_map[n] = ans
        return res % (10 ** 9 + 7)


<mask token>

class Solution:

    def numSub(self, s: str) ->int:
        s_list = s.split('0')
        ans_map = {}
        res = 0
        for i in s_list:
            n = len(i)
            if n in ans_map:
                res += ans_map[n]
            else:
                ans = (1 + n) * n // 2
                res += ans
                ans_map[n] = ans
        return res % (10 ** 9 + 7)


print(Solution().numSub('111111'))

class Solution:
    def numSub(self, s: str) -> int:
        s_list = s.split("0")
        ans_map = {}
        res = 0
        for i in s_list:
            n = len(i)
            if n in ans_map:
                res += ans_map[n]
            else:
                ans = (1+n)*n//2
                res += ans
                ans_map[n] = ans
        return res % (10**9 + 7)

print(Solution().numSub("111111"))