#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long n) {
  if (n == 0) return 1;
  long long ret = power(a, n / 2);
  ret = (ret * ret) % 1000000007;
  if (n % 2) return (ret * a) % 1000000007;
  return ret;
}
int main() {
  string s;
  int n;
  long long ans = 0;
  cin >> s;
  reverse(s.begin(), s.end());
  n = s.size();
  for (int i = int(1); i <= int(n - 1); i++) {
    if (s[i] == '1') {
      ans += power(2, i - 1);
      if (ans >= 1000000007) ans -= 1000000007;
    }
  }
  ans = (ans * power(2, n)) % 1000000007;
  if (s[0] == '1') {
    ans += power(2, n - 1);
    if (ans >= 1000000007) ans -= 1000000007;
  }
  cout << ans << endl;
  return 0;
}
