#include <bits/stdc++.h>
using namespace std;
string s;
int n;
long long p[1179657];
long long ans = 0;
long long dfs(int now) {
  if (now == n - 1) {
    if (s[now] == '1') return 1;
    return 0;
  }
  if (s[now] == '0') {
    return (dfs(now + 1) * 2) % 1000000007ll;
  } else {
    return ((p[n - now - 1] * p[n - now - 1]) % 1000000007ll +
            (dfs(now + 1) * 2) % 1000000007ll) %
           1000000007ll;
  }
}
int main() {
  cin >> s;
  n = s.length();
  p[0] = 1;
  for (int i = 1; i <= 100; i++) p[i] = (p[i - 1] * 2) % 1000000007ll;
  cout << dfs(0) << endl;
}
