#include <bits/stdc++.h>
using namespace std;
void solve() {
  string str;
  cin >> str;
  long long len = str.length();
  reverse(str.begin(), str.end());
  long long ans = 0, cnt = 1;
  for (long long i = 0; i < len; i++) {
    if (str[i] == '1') ans = (ans + cnt) % 1000000007;
    cnt = (cnt * 2) % 1000000007;
  }
  for (long long i = 0; i < len - 1; i++) {
    ans = (ans * 2) % 1000000007;
  }
  cout << ans << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
}
