#include <bits/stdc++.h>
using namespace std;
const long long N = 200, M = 1000000007;
long long i, j, k, l, m, n, o, p;
long long ans, cur;
string x;
int main() {
  cin >> x;
  ans = 0;
  n = x.size();
  for (i = 0; i <= n - 1; i++) {
    cur = 1;
    for (j = 0; j <= i - 1; j++) cur = (cur << 1) % M;
    if (x[i] == '1')
      for (j = i + 1; j <= n - 1; j++) cur = (cur << 2) % M;
    else
      cur = 0;
    ans = (ans + cur) % M;
  }
  cout << ans << endl;
  return 0;
}
