#include <bits/stdc++.h>
using namespace std;
string s;
int n, mod = 1000000007;
int powlog(int a, int b) {
  if (b == 0) return 1;
  int ret = powlog(a, b / 2);
  if (b % 2) return 1LL * ret * ret % mod * a % mod;
  return 1LL * ret * ret % mod;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> s;
  n = powlog(2, s.size() - 1);
  int x = 0;
  for (auto &i : s) x = (x * 2 + i - '0') % mod;
  cout << 1LL * n * x % mod << endl;
  return 0;
}
