#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 5;
const long long mod = 1e9 + 7;
char x[maxn];
int n;
long long pow(int b, int x) {
  long long a = (long long)b;
  long long res = 1;
  while (x) {
    if (x & 1) res = res * a % mod;
    a = a * a % mod;
    x >>= 1;
  }
  return res;
}
int main() {
  while (scanf("%s", x + 1) == 1) {
    int n = strlen(x + 1);
    long long res = 0;
    for (int i = 1; i <= n; i++) {
      if (x[i] == '0') continue;
      res = (res + pow(2, i - 1) * pow(2, n - i) % mod * pow(2, n - i) % mod) %
            mod;
    }
    cout << res << endl;
  }
  return 0;
}
