#include <bits/stdc++.h>
using namespace std;
const int mod = int(1e9 + 7);
int p[111], n;
char second[111];
int main() {
  gets(second);
  n = strlen(second);
  p[0] = 1;
  for (int i = 1; i <= n; ++i) p[i] = (p[i - 1] * 2) % mod;
  int res = 0;
  for (int i = 0; i < n; ++i)
    if (second[i] == '1') {
      int cur = p[n - i - 1];
      cur = (1LL * cur * cur) % mod;
      cur = (1LL * cur * p[i]) % mod;
      res += cur;
      if (res >= mod) res -= mod;
    }
  cout << res << endl;
  return 0;
}
