As a tradition, every year before IOI all the members of Natalia Fan Club are invited to Malek Dance Club to have a fun night together. Malek Dance Club has 2n members and coincidentally Natalia Fan Club also has 2n members. Each member of MDC is assigned a unique id i from 0 to 2n - 1. The same holds for each member of NFC.

One of the parts of this tradition is one by one dance, where each member of MDC dances with a member of NFC. A dance pair is a pair of numbers (a, b) such that member a from MDC dances with member b from NFC.

The complexity of a pairs' assignment is the number of pairs of dancing pairs (a, b) and (c, d) such that a < c and b > d.

You are given a binary number of length n named x. We know that member i from MDC dances with member <image> from NFC. Your task is to calculate the complexity of this assignment modulo 1000000007 (109 + 7).

Expression <image> denotes applying «XOR» to numbers x and y. This operation exists in all modern programming languages, for example, in C++ and Java it denotes as «^», in Pascal — «xor».

Input

The first line of input contains a binary number x of lenght n, (1 ≤ n ≤ 100).

This number may contain leading zeros.

Output

Print the complexity of the given dance assignent modulo 1000000007 (109 + 7).

Examples

Input

11


Output

6


Input

01


Output

2


Input

1


Output

1
#include <bits/stdc++.h>
const long long LL_INF = (long long)2e18 + 5;
using namespace std;
vector<long long> stone;
long long pow_of_10(long long x) {
  long long result = 1;
  for (long long i = 1; i < x + 1; i++) {
    result *= 10;
  }
  return result;
}
long long c;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool ispalin(string second) {
  string t = second;
  reverse(second.begin(), second.end());
  if (second == t) {
    return true;
  }
  return false;
}
long long yess(long long n, long long m, long long k, long long i,
               long long j) {
  while (i <= n) {
    cout << m - j + 1 << " ";
    while (j <= m) {
      cout << i << " " << j << " ";
      j++;
    }
    cout << "\n";
    j = 1;
    i++;
  }
  return 0;
}
long long power(long long base, long long exp, long long b) {
  long long ans = 1;
  while (exp > 0) {
    if (exp % 2) {
      ans *= base;
      ans %= b;
    }
    base *= base;
    base %= b;
    exp /= 2;
  }
  return ans;
}
const int MAX = 1e6 + 1;
bool prime[MAX + 1];
void sieve1() {
  for (int i = 0; i <= MAX; i++) prime[i] = 1;
  prime[0] = prime[1] = 0;
  for (int i = 4; i <= MAX; i += 2) prime[i] = 0;
  for (int p = 3; p * p <= MAX; p += 2) {
    if (prime[p] == 1)
      for (int i = p * 2; i <= MAX; i += p) {
        prime[i] = 0;
      }
  }
}
long long findSum(string str) {
  long long n = str.length();
  long long x = 0;
  for (long long i = n - 1; i >= 0; i--) {
    x += (str[i] - '0');
  }
  return x;
}
long long power(long long base, long long exp) {
  long long ans = 1;
  while (exp > 0) {
    if (exp % 2) {
      ans *= base;
      ans %= 1000000007;
    }
    base *= base;
    base %= 1000000007;
    exp /= 2;
  }
  return ans % 1000000007;
}
long long fact[1000006];
const auto MX = 300001;
vector<long long> g[MX];
long long nCr(long long n, long long r) {
  long long nn = fact[n] % 1000000007;
  long long rr = power(fact[r], 1000000007 - 2) % 1000000007;
  long long rn = power(fact[n - r], 1000000007 - 2) % 1000000007;
  return (((nn * rr) % 1000000007) * rn) % 1000000007;
}
vector<long long> vis(MX, 0);
long long mx, lvl;
void dfs(long long i, long long lvl) {
  if (vis[i]) {
    return;
  }
  vis[i] = 1;
  mx = max(lvl, mx);
  for (long long j = 0; j < g[i].size(); j++) {
    if (vis[g[i][j]] == 0) {
      dfs(g[i][j], lvl + 1);
    }
  }
  return;
}
long long divi(long long a, long long b) { return (a + b - 1) / b; }
long long solve() {
  string x;
  cin >> x;
  long long pot[101];
  pot[0] = 1;
  for (long long i = 1; i < 101; i++) {
    pot[i] = pot[i - 1] * 2;
    if (pot[i] > 1000000007) {
      pot[i] -= 1000000007;
    }
  }
  long long n = x.length();
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    if (x[i] == '1') {
      ans += pot[n - 1 - i];
      if (ans > 1000000007) ans -= 1000000007;
    }
  }
  ans = ans * pot[n - 1] % 1000000007;
  cout << ans << " ";
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long flag = 0;
  if (flag) {
    long long t;
    cin >> t;
    while (t--) {
      solve();
    }
  } else {
    solve();
  }
  return 0;
}
