#include <bits/stdc++.h>
using namespace std;
int main() {
  long long ans = 0, mod = 1000000007, i, j, k, len, mult = 1, mult1 = 1;
  char s[101];
  scanf("%s", &s);
  for (i = 0; s[i] != '\0'; i++)
    ;
  len = i;
  for (i = 0; i < len - 1; i++) mult = (mult * 2) % mod;
  for (i = len - 1; i >= 0; i--) {
    if (s[i] == '1') ans = (ans + mult1 * mult + mod) % mod;
    mult1 = (mult1 * 2) % mod;
  }
  cout << ans;
}
