#include <bits/stdc++.h>
using namespace std;
int const mod = 1e9 + 7;
int pow2(int b) {
  int ans = 1;
  int tmp = 2;
  while (b) {
    if (b % 2) ans = (ans * 1LL * tmp) % mod;
    tmp = (tmp * 1LL * tmp) % mod;
    b /= 2;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  string s;
  cin >> s;
  int n = s.length();
  int ans = 0;
  for (int i = 0; i < n; ++i)
    if (s[i] == '1') {
      ans += pow2(2 * n - i - 2);
      if (ans >= mod) ans -= mod;
    }
  cout << ans << endl;
  return 0;
}
