#include <bits/stdc++.h>
using namespace std;
long long p[110];
int main() {
  p[0] = 1;
  for (int i = 1; i <= 100; i++) p[i] = p[i - 1] * 2 % 1000000007;
  char s[110];
  cin >> s;
  long long ans = 0;
  int n = strlen(s);
  for (int i = 0; s[i]; i++) {
    if (s[i] == '1') {
      ans += p[n - 1 - i] % 1000000007 * p[n - 1 - i] % 1000000007 * p[i] %
             1000000007;
      ans %= 1000000007;
    }
  }
  cout << ans << endl;
}
