#include <bits/stdc++.h>
using namespace std;
long long mexp(long long x, long long y) {
  if (y == 0) return 1;
  if (y == 1) return x;
  long long ans = mexp(x, y / 2) % 1000000007;
  ans = (ans * ans) % 1000000007;
  if (y & 1) ans = (ans * x) % 1000000007;
  return ans;
}
int main() {
  string s;
  cin >> s;
  int n = s.size();
  long long a1 = mexp(2, n - 1);
  long long a2 = 0;
  for (int i = n - 1; i >= 0; i--)
    if (s[i] == '1') a2 = (a2 + mexp(2, n - 1 - i)) % 1000000007;
  cout << (a1 * a2) % 1000000007;
  return 0;
}
