#include <bits/stdc++.h>
using namespace std;
int main() {
  string x;
  cin >> x;
  long long res = 0;
  for (int i = 0; i < x.length(); ++i) {
    if (x[i] == '1')
      res = (2 * res + 1) % 1000000007;
    else
      res = (2 * res) % 1000000007;
  }
  for (int i = 0; i < x.length() - 1; ++i) res = (2 * res) % 1000000007;
  cout << res;
  return 0;
}
