L=input()

MOD = 10**9+7
class Mint:
    def __init__(self, value=0):
        self.value = value % MOD
        if self.value < 0: self.value += MOD

    @staticmethod
    def get_value(x): return x.value if isinstance(x, Mint) else x

    def inverse(self):
        a, b = self.value, MOD
        u, v = 1, 0
        while b:
            t = a // b
            b, a = a - t * b, b
            v, u = u - t * v, v
        if u < 0: u += MOD
        return u

    def __repr__(self): return str(self.value)
    def __eq__(self, other): return self.value == other.value
    def __neg__(self): return Mint(-self.value)
    def __hash__(self): return hash(self.value)
    def __bool__(self): return self.value != 0

    def __iadd__(self, other):
        self.value += Mint.get_value(other)
        if self.value >= MOD: self.value -= MOD
        return self
    def __add__(self, other):
        new_obj = Mint(self.value)
        new_obj += other
        return new_obj
    __radd__ = __add__

    def __isub__(self, other):
        self.value -= Mint.get_value(other)
        if self.value < 0: self.value += MOD
        return self
    def __sub__(self, other):
        new_obj = Mint(self.value)
        new_obj -= other
        return new_obj
    def __rsub__(self, other):
        new_obj = Mint(Mint.get_value(other))
        new_obj -= self
        return new_obj

    def __imul__(self, other):
        self.value = self.value * Mint.get_value(other) % MOD
        return self
    def __mul__(self, other):
        new_obj = Mint(self.value)
        new_obj *= other
        return new_obj
    __rmul__ = __mul__

    def __ifloordiv__(self, other):
        other = other if isinstance(other, Mint) else Mint(other)
        self *= other.inverse()
        return self
    def __floordiv__(self, other):
        new_obj = Mint(self.value)
        new_obj //= other
        return new_obj
    def __rfloordiv__(self, other):
        new_obj = Mint(Mint.get_value(other))
        new_obj //= self
        return new_obj

d0 = Mint(1)
d1 = Mint()
for b in L:
    if b == '0':
        d1 *= (1 + 2)
        #d0 *= (1 + 0)
    else:
        d1 = d1 * (1 + 2) + d0
        d0 *= (0 + 2)

print(d0+d1) L=input() L input() input MOD = 10**9+7 MOD 10**9+7 10**9 10 9 7 class Mint:
    def __init__(self, value=0):
        self.value = value % MOD
        if self.value < 0: self.value += MOD

    @staticmethod
    def get_value(x): return x.value if isinstance(x, Mint) else x

    def inverse(self):
        a, b = self.value, MOD
        u, v = 1, 0
        while b:
            t = a // b
            b, a = a - t * b, b
            v, u = u - t * v, v
        if u < 0: u += MOD
        return u

    def __repr__(self): return str(self.value)
    def __eq__(self, other): return self.value == other.value
    def __neg__(self): return Mint(-self.value)
    def __hash__(self): return hash(self.value)
    def __bool__(self): return self.value != 0

    def __iadd__(self, other):
        self.value += Mint.get_value(other)
        if self.value >= MOD: self.value -= MOD
        return self
    def __add__(self, other):
        new_obj = Mint(self.value)
        new_obj += other
        return new_obj
    __radd__ = __add__

    def __isub__(self, other):
        self.value -= Mint.get_value(other)
        if self.value < 0: self.value += MOD
        return self
    def __sub__(self, other):
        new_obj = Mint(self.value)
        new_obj -= other
        return new_obj
    def __rsub__(self, other):
        new_obj = Mint(Mint.get_value(other))
        new_obj -= self
        return new_obj

    def __imul__(self, other):
        self.value = self.value * Mint.get_value(other) % MOD
        return self
    def __mul__(self, other):
        new_obj = Mint(self.value)
        new_obj *= other
        return new_obj
    __rmul__ = __mul__

    def __ifloordiv__(self, other):
        other = other if isinstance(other, Mint) else Mint(other)
        self *= other.inverse()
        return self
    def __floordiv__(self, other):
        new_obj = Mint(self.value)
        new_obj //= other
        return new_obj
    def __rfloordiv__(self, other):
        new_obj = Mint(Mint.get_value(other))
        new_obj //= self
        return new_obj Mint def __init__(self, value=0):
        self.value = value % MOD
        if self.value < 0: self.value += MOD

     __init__ self.value = value % MOD self.value self value value % MOD value MOD if self.value < 0: self.value += MOD

     self.value < 0 self.value self value 0 self self value=0 value 0 def get_value(x): return x.value if isinstance(x, Mint) else x

     get_value x x @staticmethod
     get_value staticmethod get_value def inverse(self):
        a, b = self.value, MOD
        u, v = 1, 0
        while b:
            t = a // b
            b, a = a - t * b, b
            v, u = u - t * v, v
        if u < 0: u += MOD
        return u

     inverse a, b = self.value, MOD a self.value self value b MOD u, v = 1, 0 u 1 v 0 while b:
            t = a // b
            b, a = a - t * b, b
            v, u = u - t * v, v
         b t = a // b t a // b a b b, a = a - t * b, b b a - t * b a t * b t b a b v, u = u - t * v, v v u - t * v u t * v t v u v if u < 0: u += MOD
         u < 0 u 0 return u u self self def __repr__(self): return str(self.value)
     __repr__ self self def __eq__(self, other): return self.value == other.value
     __eq__ self self other other def __neg__(self): return Mint(-self.value)
     __neg__ self self def __hash__(self): return hash(self.value)
     __hash__ self self def __bool__(self): return self.value != 0

     __bool__ self self def __iadd__(self, other):
        self.value += Mint.get_value(other)
        if self.value >= MOD: self.value -= MOD
        return self
     __iadd__ self.value += Mint.get_value(other) self.value self value Mint.get_value(other) Mint.get_value Mint get_value other if self.value >= MOD: self.value -= MOD
         self.value >= MOD self.value self value MOD return self self self self other other def __add__(self, other):
        new_obj = Mint(self.value)
        new_obj += other
        return new_obj
     __add__ new_obj = Mint(self.value) new_obj Mint(self.value) Mint self.value self value new_obj += other new_obj other return new_obj new_obj self self other other __radd__ = __add__ __radd__ __add__ def __isub__(self, other):
        self.value -= Mint.get_value(other)
        if self.value < 0: self.value += MOD
        return self
     __isub__ self.value -= Mint.get_value(other) self.value self value Mint.get_value(other) Mint.get_value Mint get_value other if self.value < 0: self.value += MOD
         self.value < 0 self.value self value 0 return self self self self other other def __sub__(self, other):
        new_obj = Mint(self.value)
        new_obj -= other
        return new_obj
     __sub__ new_obj = Mint(self.value) new_obj Mint(self.value) Mint self.value self value new_obj -= other new_obj other return new_obj new_obj self self other other def __rsub__(self, other):
        new_obj = Mint(Mint.get_value(other))
        new_obj -= self
        return new_obj

     __rsub__ new_obj = Mint(Mint.get_value(other)) new_obj Mint(Mint.get_value(other)) Mint Mint.get_value(other) Mint.get_value Mint get_value other new_obj -= self new_obj self return new_obj new_obj self self other other def __imul__(self, other):
        self.value = self.value * Mint.get_value(other) % MOD
        return self
     __imul__ self.value = self.value * Mint.get_value(other) % MOD self.value self value self.value * Mint.get_value(other) % MOD self.value * Mint.get_value(other) self.value self value Mint.get_value(other) Mint.get_value Mint get_value other MOD return self self self self other other def __mul__(self, other):
        new_obj = Mint(self.value)
        new_obj *= other
        return new_obj
     __mul__ new_obj = Mint(self.value) new_obj Mint(self.value) Mint self.value self value new_obj *= other new_obj other return new_obj new_obj self self other other __rmul__ = __mul__ __rmul__ __mul__ def __ifloordiv__(self, other):
        other = other if isinstance(other, Mint) else Mint(other)
        self *= other.inverse()
        return self
     __ifloordiv__ other = other if isinstance(other, Mint) else Mint(other) other other if isinstance(other, Mint) else Mint(other) isinstance(other, Mint) isinstance other Mint other Mint(other) Mint other self *= other.inverse() self other.inverse() other.inverse other inverse return self self self self other other def __floordiv__(self, other):
        new_obj = Mint(self.value)
        new_obj //= other
        return new_obj
     __floordiv__ new_obj = Mint(self.value) new_obj Mint(self.value) Mint self.value self value new_obj //= other new_obj other return new_obj new_obj self self other other def __rfloordiv__(self, other):
        new_obj = Mint(Mint.get_value(other))
        new_obj //= self
        return new_obj __rfloordiv__ new_obj = Mint(Mint.get_value(other)) new_obj Mint(Mint.get_value(other)) Mint Mint.get_value(other) Mint.get_value Mint get_value other new_obj //= self new_obj self return new_obj new_obj self self other other d0 = Mint(1) d0 Mint(1) Mint 1 d1 = Mint() d1 Mint() Mint for b in L:
    if b == '0':
        d1 *= (1 + 2)
        #d0 *= (1 + 0)
    else:
        d1 = d1 * (1 + 2) + d0
        d0 *= (0 + 2) b L if b == '0':
        d1 *= (1 + 2)
        #d0 *= (1 + 0)
    else:
        d1 = d1 * (1 + 2) + d0
        d0 *= (0 + 2) b == '0' b '0' d1 *= (1 + 2) d1 1 + 2 1 2 d1 = d1 * (1 + 2) + d0 d1 d1 * (1 + 2) + d0 d1 * (1 + 2) d1 1 + 2 1 2 d0 d0 *= (0 + 2) d0 0 + 2 0 2 print(d0+d1) print d0+d1 d0 d1 d1 *= (1 + 2) 1 + 2 d1 MOD = 10**9+7 10**9+7 MOD class Mint:
    def __init__(self, value=0):
        self.value = value % MOD
        if self.value < 0: self.value += MOD

    @staticmethod
    def get_value(x): return x.value if isinstance(x, Mint) else x

    def inverse(self):
        a, b = self.value, MOD
        u, v = 1, 0
        while b:
            t = a // b
            b, a = a - t * b, b
            v, u = u - t * v, v
        if u < 0: u += MOD
        return u

    def __repr__(self): return str(self.value)
    def __eq__(self, other): return self.value == other.value
    def __neg__(self): return Mint(-self.value)
    def __hash__(self): return hash(self.value)
    def __bool__(self): return self.value != 0

    def __iadd__(self, other):
        self.value += Mint.get_value(other)
        if self.value >= MOD: self.value -= MOD
        return self
    def __add__(self, other):
        new_obj = Mint(self.value)
        new_obj += other
        return new_obj
    __radd__ = __add__

    def __isub__(self, other):
        self.value -= Mint.get_value(other)
        if self.value < 0: self.value += MOD
        return self
    def __sub__(self, other):
        new_obj = Mint(self.value)
        new_obj -= other
        return new_obj
    def __rsub__(self, other):
        new_obj = Mint(Mint.get_value(other))
        new_obj -= self
        return new_obj

    def __imul__(self, other):
        self.value = self.value * Mint.get_value(other) % MOD
        return self
    def __mul__(self, other):
        new_obj = Mint(self.value)
        new_obj *= other
        return new_obj
    __rmul__ = __mul__

    def __ifloordiv__(self, other):
        other = other if isinstance(other, Mint) else Mint(other)
        self *= other.inverse()
        return self
    def __floordiv__(self, other):
        new_obj = Mint(self.value)
        new_obj //= other
        return new_obj
    def __rfloordiv__(self, other):
        new_obj = Mint(Mint.get_value(other))
        new_obj //= self
        return new_obj class Mint:
    def __init__(self, value=0):
        self.value = value % MOD
        if self.value < 0: self.value += MOD

    @staticmethod
    def get_value(x): return x.value if isinstance(x, Mint) else x

    def inverse(self):
        a, b = self.value, MOD
        u, v = 1, 0
        while b:
            t = a // b
            b, a = a - t * b, b
            v, u = u - t * v, v
        if u < 0: u += MOD
        return u

    def __repr__(self): return str(self.value)
    def __eq__(self, other): return self.value == other.value
    def __neg__(self): return Mint(-self.value)
    def __hash__(self): return hash(self.value)
    def __bool__(self): return self.value != 0

    def __iadd__(self, other):
        self.value += Mint.get_value(other)
        if self.value >= MOD: self.value -= MOD
        return self
    def __add__(self, other):
        new_obj = Mint(self.value)
        new_obj += other
        return new_obj
    __radd__ = __add__

    def __isub__(self, other):
        self.value -= Mint.get_value(other)
        if self.value < 0: self.value += MOD
        return self
    def __sub__(self, other):
        new_obj = Mint(self.value)
        new_obj -= other
        return new_obj
    def __rsub__(self, other):
        new_obj = Mint(Mint.get_value(other))
        new_obj -= self
        return new_obj

    def __imul__(self, other):
        self.value = self.value * Mint.get_value(other) % MOD
        return self
    def __mul__(self, other):
        new_obj = Mint(self.value)
        new_obj *= other
        return new_obj
    __rmul__ = __mul__

    def __ifloordiv__(self, other):
        other = other if isinstance(other, Mint) else Mint(other)
        self *= other.inverse()
        return self
    def __floordiv__(self, other):
        new_obj = Mint(self.value)
        new_obj //= other
        return new_obj
    def __rfloordiv__(self, other):
        new_obj = Mint(Mint.get_value(other))
        new_obj //= self
        return new_obj Mint d1 = Mint() Mint() d1 d0 *= (0 + 2) 0 + 2 d0 d0 = Mint(1) Mint(1) d0 L=input() input() L d1 = d1 * (1 + 2) + d0 d1 * (1 + 2) + d0 d1
L=input()

MOD = 10**9+7
class Mint:
    def __init__(self, value=0):
        self.value = value % MOD
        if self.value < 0: self.value += MOD

    @staticmethod
    def get_value(x): return x.value if isinstance(x, Mint) else x

    def inverse(self):
        a, b = self.value, MOD
        u, v = 1, 0
        while b:
            t = a // b
            b, a = a - t * b, b
            v, u = u - t * v, v
        if u < 0: u += MOD
        return u

    def __repr__(self): return str(self.value)
    def __eq__(self, other): return self.value == other.value
    def __neg__(self): return Mint(-self.value)
    def __hash__(self): return hash(self.value)
    def __bool__(self): return self.value != 0

    def __iadd__(self, other):
        self.value += Mint.get_value(other)
        if self.value >= MOD: self.value -= MOD
        return self
    def __add__(self, other):
        new_obj = Mint(self.value)
        new_obj += other
        return new_obj
    __radd__ = __add__

    def __isub__(self, other):
        self.value -= Mint.get_value(other)
        if self.value < 0: self.value += MOD
        return self
    def __sub__(self, other):
        new_obj = Mint(self.value)
        new_obj -= other
        return new_obj
    def __rsub__(self, other):
        new_obj = Mint(Mint.get_value(other))
        new_obj -= self
        return new_obj

    def __imul__(self, other):
        self.value = self.value * Mint.get_value(other) % MOD
        return self
    def __mul__(self, other):
        new_obj = Mint(self.value)
        new_obj *= other
        return new_obj
    __rmul__ = __mul__

    def __ifloordiv__(self, other):
        other = other if isinstance(other, Mint) else Mint(other)
        self *= other.inverse()
        return self
    def __floordiv__(self, other):
        new_obj = Mint(self.value)
        new_obj //= other
        return new_obj
    def __rfloordiv__(self, other):
        new_obj = Mint(Mint.get_value(other))
        new_obj //= self
        return new_obj

d0 = Mint(1)
d1 = Mint()
for b in L:
    if b == '0':
        d1 *= (1 + 2)
        #d0 *= (1 + 0)
    else:
        d1 = d1 * (1 + 2) + d0
        d0 *= (0 + 2)

print(d0+d1)