#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
string s;
int main() {
  ios::sync_with_stdio(0);
  cin >> s;
  int n = s.length();
  long long ans = 1;
  for (int i = 0; i < n - 1; i++) ans = (ans * 2) % MOD;
  long long cur = 0;
  for (int i = 0; i < n; i++) cur = (cur * 2 + (s[i] - '0')) % MOD;
  cout << (ans * cur) % MOD;
  return 0;
}
