#include <bits/stdc++.h>
using namespace std;
long long num[110];
long long md = 1000000007;
int main() {
  string s;
  cin >> s;
  num[0] = 1;
  for (int i = 1; i <= 107; ++i) {
    num[i] = num[i - 1] * 2;
    num[i] %= md;
  }
  int n = s.size();
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '1') {
      long long r = num[i] * num[n - 1 - i];
      r %= md;
      r *= num[n - 1 - i];
      r %= md;
      ans += r;
      ans %= md;
    }
  }
  cout << ans << endl;
  return 0;
}
