#include <bits/stdc++.h>
using namespace std;
long long const mod = 1000000007;
int main() {
  long long t = 0, r = 1;
  string s;
  cin >> s;
  for (int i = (int)s.size() - 1, num = 1; i >= 0; --i, num = (num * 2) % mod) {
    t = (t + (num * (s[i] - '0'))) % mod;
    if (i != 0) r = (r * 2) % mod;
  }
  cout << (t * r) % mod;
  return 0;
}
