#include <bits/stdc++.h>
using namespace std;
long long nChooseR(int n, int k);
long long gcd(long long a, long long b);
vector<string> split(string target, char c);
bool isPrime(long long g);
long long n, k, r, l, t, x, y, m, a[100003];
long long ans;
int main() {
  string s;
  cin >> s;
  reverse(((s).begin()), ((s).end()));
  ans = s[0] == '1';
  n = ((int)((s).size()));
  x = 1;
  for (int i = 0; i < (int)(n - 1); i++) {
    x *= 4;
    x %= 1000000007;
    if (s[i + 1] == '1')
      ans = ans * 2 + x;
    else
      ans *= 2;
    ans %= 1000000007;
  }
  cout << ans;
  return 0;
}
long long nChooseR(int n, int k) {
  if (k > n) return 0;
  if (k * 2 > n) k = n - k;
  if (k == 0) return 1;
  long long result = n;
  for (int i = 2; i <= k; ++i) {
    result *= (n - i + 1);
    result /= i;
  }
  return result;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
vector<string> split(string target, char c) {
  string d = "";
  vector<string> arr;
  for (auto n : target) {
    if (n != c)
      d += n;
    else if (d != "")
      arr.push_back(d), d = "";
  }
  if (d != "") arr.push_back(d), d = "";
  return arr;
}
bool isPrime(long long g) {
  if ((g % 2 == 0 && g > 2) || g == 1) return 0;
  for (int i = 3; i * i <= g; i += 2)
    if (g % i == 0) return 0;
  return 1;
}
