#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  string s;
  cin >> s;
  long long ans = 0;
  long long power = 1;
  for (int i = 1; i < s.size(); ++i) power = (power * 2) % mod;
  long long cur = 1;
  for (int i = s.size() - 1; i >= 0; i--) {
    if (s[i] == '1') ans = (ans + cur * power) % mod;
    cur = (cur * 2) % mod;
  }
  cout << ans;
  return 0;
}
