#include <bits/stdc++.h>
using namespace std;
const long double pi = acos(-1);
long long power(long long x, long long y) {
  if (y == 0) return 1;
  long long temp = power(x, y / 2) % 1000000007;
  temp *= temp;
  temp %= 1000000007;
  if (y % 2) temp *= x;
  return temp % 1000000007;
}
int main() {
  string second;
  cin >> second;
  bitset<200> b;
  for (int i = 0; i < second.size(); i++) {
    if (second[second.size() - i - 1] == '1') b[i] = 1;
  }
  long long ans = 0;
  for (int i = 0; i < second.size(); i++) {
    ans += power(2, i) * (long long)b[i];
    ans %= 1000000007;
  }
  cout << (ans * power(2, second.size() - 1) % 1000000007) % 1000000007 << endl;
}
