#include <bits/stdc++.h>
using namespace std;
char s[105];
int main() {
  gets(s);
  int x = 0;
  for (int i = 0; s[i]; i++) x = (x * 2 + s[i] - '0') % 1000000007;
  for (int i = 1; s[i]; i++) x = (x * 2) % 1000000007;
  printf("%d\n", x);
  return 0;
}
