#include <bits/stdc++.h>
using namespace std;
int mod = 1e9 + 7;
long long pw(int u, int e) {
  if (!e) return 1;
  if (e == 1) return u;
  long long temp = pw(u, e / 2);
  temp = (temp * temp) % mod;
  if (e % 2) temp = (temp * u) % mod;
  return temp;
}
int main() {
  string x;
  cin >> x;
  int ans = 0, l = x.length() - 1;
  for (int i = l; i >= 0; i--) {
    if (x[i] == '0')
      ans = (ans * 2) % mod;
    else
      ans = (ans * 2 + pw(2, 2 * (l - i))) % mod;
  }
  printf("%d", ans);
}
