#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long MOD = 1000000007;
const int N = 100;
int main() {
  string s;
  while (cin >> s) {
    long long sum = 0;
    for (unsigned int i = 0; i < s.size(); ++i)
      if (s[i] == '1') {
        long long tmp = 1;
        for (unsigned int j = 0; j < i; ++j) {
          tmp = tmp * 2 % MOD;
        }
        for (unsigned int j = i + 1; j < s.size(); ++j) {
          tmp = tmp * 4 % MOD;
        }
        sum = (sum + tmp) % MOD;
      }
    cout << sum << endl;
  }
}
