#include <bits/stdc++.h>
using namespace std;
long long p2[105];
int main(void) {
  string s;
  cin >> s;
  p2[0] = 1;
  for (int i = 1; i <= 100; i++) p2[i] = p2[i - 1] << 1, p2[i] %= 1000000007;
  int n = s.size();
  long long ans = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '1') {
      ans +=
          (p2[n - i - 1] * p2[n - 1 - i]) % 1000000007 * (p2[i]) % 1000000007;
      ans %= 1000000007;
    }
  }
  cout << ans << endl;
}
