#include <bits/stdc++.h>
using namespace std;
int M = 1000000007;
long long int res[110];
int main() {
  string s;
  cin >> s;
  long long int p = 1;
  for (int i = 1; i < s.length(); ++i) {
    p <<= 1;
    p %= M;
  }
  long long int ans = 0;
  res[0] = p;
  for (int i = 1; i < s.length(); ++i) {
    res[i] = res[i - 1] << 1;
    res[i] %= M;
  }
  int l = s.length() - 1;
  for (int i = 0; i < s.length(); ++i) {
    if (s[l - i] == '1') {
      ans += res[i];
      ans %= M;
    }
  }
  cout << ans;
  return 0;
}
