#include <bits/stdc++.h>
using namespace std;
char s[120];
int n, pw[120];
int main() {
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  pw[0] = 1;
  for (int i = 1; i <= 100; ++i) pw[i] = (long long)pw[i - 1] * 2 % 1000000007;
  int ans = 0;
  int mul = 1;
  for (int i = 1; i <= n; ++i) {
    if (s[i] == '1') {
      long long inc = 0;
      inc = pw[n - i];
      inc = inc * inc % 1000000007;
      ans = (ans + inc * pw[i - 1] % 1000000007) % 1000000007;
    }
  }
  cout << ans << endl;
  return 0;
}
