#include <bits/stdc++.h>
using namespace std;
string s;
long long int l, sm;
long long int two = 1;
int main() {
  long long int pw = 1;
  cin >> s;
  l = s.size();
  long long int i, j;
  for (i = 1; i < l; ++i) {
    pw *= 2;
    pw %= 1000000007;
  }
  for (i = l - 1; i >= 0; --i) {
    if (s[i] == '1') {
      sm += (two * pw) % 1000000007;
      sm %= 1000000007;
    }
    two *= 2;
    two %= 1000000007;
  }
  cout << sm << endl;
  return 0;
}
