#include <bits/stdc++.h>
using namespace std;
int MOD = 1000000007;
string s;
int main() {
  int i, sz, count = 0, power;
  cin >> s;
  sz = s.size();
  power = 1;
  for (i = 1; i < sz; i++) {
    power *= 2;
    power %= MOD;
  }
  for (i = sz - 1; i >= 0; i--) {
    if (s[i] == '1') count += power;
    power *= 2;
    power %= MOD;
    count %= MOD;
  }
  cout << count << endl;
}
