#include <bits/stdc++.h>
using namespace std;
const int maxn = 110;
const int MOD = 1000000007;
long long bin;
int n;
void ToBin(char *s) {
  bin = 0;
  for (int i = 0; i < n; i++) {
    bin <<= 1;
    bin = bin | (s[i] == '1');
    bin %= MOD;
  }
}
void BinMove(int x) {
  for (int i = 0; i < x; i++) {
    bin <<= 1;
    bin %= MOD;
  }
}
int main() {
  char str[maxn];
  while (scanf("%s", str) == 1) {
    n = strlen(str);
    ToBin(str);
    BinMove(n - 1);
    cout << bin << endl;
  }
  return 0;
}
