#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  long long n = s.size(), cp = 1, mod = 1000000007, ans = 0;
  for (int i = 1; i < n; i++) cp = (cp * 2) % mod;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '1') ans = (ans + cp) % mod;
    cp = (cp * 2) % mod;
  }
  cout << ans << '\n';
  return 0;
}
