#include <bits/stdc++.h>
using namespace std;
long long md = 1000000007LL;
long long pw[2000];
char xo[2000];
int main() {
  scanf("%s", xo);
  pw[0] = 1;
  for (long long i = 1; i < 2000; i++) {
    pw[i] = (pw[i - 1] * 2LL) % md;
  }
  long long i;
  long long sm = 0;
  for (i = 0; xo[i] != '\0'; i++)
    ;
  for (long long j = 0; j < i; j++) {
    if (xo[j] == '1') {
      sm += pw[2LL * i - j - 2LL];
      sm %= md;
    }
  }
  int osm = sm;
  printf("%d\n", osm);
  return 0;
}
