#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007LL;
long long power[101];
void calc() {
  power[0] = 1;
  for (int i = 1; i <= 100; i++) {
    power[i] = 4 * power[i - 1] % MOD;
  }
}
int main() {
  calc();
  string num;
  cin >> num;
  int dig = num.size();
  long long x = 0LL;
  for (int i = 0; i < dig; i++) {
    char c = num[dig - i - 1];
    if (c == '1') {
      x = (2 * x) % MOD;
      x = (x + power[i]) % MOD;
    } else if (c == '0') {
      x = (2 * x) % MOD;
    }
  }
  cout << x << endl;
}
