#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
const int maxN = 1e2 + 1000;
long long int dp[maxN];
int main() {
  string s;
  cin >> s;
  reverse(s.begin(), s.end());
  if (s[0] == '0')
    dp[0] = 0;
  else
    dp[0] = 1;
  for (int i = 1; i < s.size(); i++)
    if (s[i] == '0') {
      dp[i] = 2 * dp[i - 1];
      dp[i] %= M;
    } else {
      long long int ad = 1;
      for (int j = 1; j <= 2 * i; j++) {
        ad *= 2;
        ad %= M;
      }
      dp[i] = (long long)2 * dp[i - 1] + ad;
      dp[i] %= M;
    }
  cout << dp[s.size() - 1] << endl;
  return 0;
}
