#include <bits/stdc++.h>
using namespace std;
long long fp(long long a, int b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % 1000000007;
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return ans;
}
int main() {
  string x;
  getline(cin, x);
  int n = x.size();
  long long ans = 0, m = 1;
  for (int i = 0; i < x.size(); i++) {
    if (x[i] == '1') ans = (ans + m * fp(2, 2 * (n - i - 1))) % 1000000007;
    m = (2 * m) % 1000000007;
  }
  cout << ans << endl;
}
