#include <bits/stdc++.h>
using namespace std;
using LL = long long;
const int base = 1000000007;
int main() {
  string s;
  cin >> s;
  int n = s.size();
  int res = 0;
  for (int i = 0; i < n; ++i) {
    res *= 2;
    if (s[i] == '1') res++;
    if (res >= base) res %= base;
  }
  for (int i = 0; i < n - 1; i++) {
    res *= 2;
    if (res >= base) res %= base;
  }
  cout << res;
}
