#include <bits/stdc++.h>
using namespace std;
int n, m, len;
char p[1000];
int done[1000];
long long ans = 0;
long long p2[1000];
int main() {
  int i, j;
  scanf("%s", p);
  p2[0] = 1;
  for (i = 1; i <= 200; ++i) p2[i] = (p2[i - 1] * 2) % 1000000007;
  len = strlen(p);
  for (i = 0; i < len; ++i) done[i] = p[len - i - 1] - '0';
  for (i = 0; i < len; ++i) {
    ans = (ans * 2) % 1000000007;
    if (done[i] == 1) ans = (ans + p2[i] * p2[i]) % 1000000007;
  }
  cout << ans;
  return 0;
}
