#include <bits/stdc++.h>
using namespace std;
int expmod(int n) {
  if (n == 0)
    return 1;
  else {
    if (n % 2 == 0) {
      long long int ans = expmod(n / 2);
      return ((ans % 1000000007) * (ans % 1000000007)) % 1000000007;
    } else {
      long long int ans = expmod(n / 2);
      return (((ans % 1000000007) * (ans % 1000000007)) % 1000000007 * 2) %
             1000000007;
    }
  }
}
int main() {
  string s;
  cin >> s;
  int sz = s.length();
  int n = expmod(sz - 1);
  long long ans = 0;
  int k = 1;
  long long temp = n;
  for (int i = sz - 1; i >= 0; i--) {
    ans = (ans + temp * (s[i] - '0')) % 1000000007;
    temp = (2 * temp) % 1000000007;
  }
  cout << ans << "\n";
  return 0;
}
