#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
char s[102];
int dp[102];
int p[202];
int n;
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  p[0] = 1;
  for (int i = 1; i <= 2 * n; i++) p[i] = (p[i - 1] * 2) % mod;
  for (int i = n; i >= 1; i--) {
    dp[i] = dp[i + 1] * 2;
    dp[i] %= mod;
    if (s[i] == '1') {
      dp[i] += p[2 * (n - i)];
      dp[i] %= mod;
    }
  }
  printf("%d\n", dp[1]);
  return 0;
}
