#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int main() {
  long long i, j, k;
  string s;
  char ch;
  cin >> s;
  j = s.length();
  long long dp[j], tp[202];
  tp[0] = 1;
  for (i = 1; i < 202; i++) tp[i] = (2 * tp[i - 1]) % mod;
  if (s[j - 1] == '0')
    dp[0] = 0;
  else
    dp[0] = 1;
  for (i = 1; i < j; i++) {
    ch = s[j - 1 - i];
    if (ch == '1')
      dp[i] = (tp[2 * i] + 2 * dp[i - 1]) % mod;
    else
      dp[i] = (2 * dp[i - 1]) % mod;
  }
  cout << dp[j - 1];
}
