#include <bits/stdc++.h>
using namespace std;
long long int power_mod(int n) {
  long long int pro = 1;
  for (int i = 1; i <= n; i++) {
    pro = (pro * 2) % 1000000007;
  }
  return pro;
}
int main() {
  char s[110];
  cin >> s;
  int i;
  int n = strlen(s);
  long long int solution[n + 2];
  solution[0] = 0;
  for (i = 1; i <= n; i++) {
    if (s[n - i] == '0') {
      solution[i] = (2 * solution[i - 1]) % 1000000007;
    } else {
      solution[i] = (2 * solution[i - 1]) % 1000000007;
      solution[i] =
          (solution[i] + (power_mod(i - 1) * power_mod(i - 1)) % 1000000007) %
          1000000007;
    }
  }
  cout << solution[n] << "\n";
  return 0;
}
