#include <bits/stdc++.h>
using namespace std;
long long arr[110] = {0}, arr2[110] = {0}, arr3[110] = {0}, sum = 0;
long long solve(long long n, long long d) {
  arr3[1] = n;
  if (arr[1] > 0) {
    sum += (n % 1000000007);
    sum %= 1000000007;
  }
  for (long long g = 2; g <= d; ++g) {
    arr3[g] = (arr3[g - 1] * 2) % 1000000007;
    if (arr[g] > 0) {
      sum += arr3[g];
      sum %= 1000000007;
    }
  }
  return (sum % 1000000007);
}
int main() {
  ios_base::sync_with_stdio(0);
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  for (unsigned v = 1, i = s.size() - 1; i >= 0 && v <= s.size(); --i, ++v)
    arr[v] = s[i] - '0';
  arr2[1] = 1;
  for (long long k = 2; k <= 100; ++k)
    arr2[k] = ((arr2[k - 1] * 2) % 1000000007);
  cout << (solve(arr2[s.size()], s.size())) << "\n";
  return 0;
}
