#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
char ch;
int n;
int m;
int main() {
  while (cin >> ch) {
    ++n;
    m = (m * 2 + (ch == '1')) % mod;
  }
  for (int i = 0; i < n - 1; ++i) {
    m = (m * 2) % mod;
  }
  cout << m << endl;
  return 0;
}
