#include <bits/stdc++.h>
using namespace std;
int mod = 1000000007;
int calc(int u) {
  if (!u) return 1;
  if (u & 1) return (calc(u - 1) * 2) % mod;
  int t = calc(u / 2);
  return (1ll * t * t) % mod;
}
int main(int argc, char **argv) {
  string str;
  cin >> str;
  int n = str.size();
  reverse(str.begin(), str.end());
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    if (str[i] == '0') continue;
    ans += (1ll * calc(i + n - 1)) % mod;
    ans %= mod;
  }
  printf("%d\n", ans);
  return 0;
}
