#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int MAX = 2e3 + 5;
const long long MAX2 = 11;
const long long MOD = 1000000007;
const long long INF = 2e18;
const int dr[] = {1, 0, -1, 0, 1, 1, -1, -1, 0};
const int dc[] = {0, 1, 0, -1, 1, -1, 1, -1, 0};
const double pi = acos(-1);
const double EPS = 1e-9;
const int block = 450;
long long ans, mul, x;
string s;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  mul = 1;
  for (long long i = 2; i <= s.size(); ++i) mul = (mul << 1) % MOD;
  reverse(s.begin(), s.end());
  x = 1;
  for (auto i : s) {
    if (i == '1') ans = (ans + x * mul) % MOD;
    x = (x << 1) % MOD;
  }
  cout << ans << "\n";
  return 0;
}
