#include <bits/stdc++.h>
using namespace std;
const long long M = 1e9 + 7, mxN = 300;
string x;
long long n, powers[mxN];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> x;
  n = x.length();
  powers[0] = 1;
  powers[1] = 2;
  for (long long i = 2; i < mxN; i++) powers[i] = (powers[i - 1] << 1) % M;
  long long ans = 0;
  for (long long i = n - 1; i >= 0; i--) {
    ans = (2 * ans) % M;
    if (x[i] == '1') ans = (ans + powers[2 * (n - i - 1)]) % M;
  }
  cout << ans;
  return 0;
}
