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