#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
string s;
void solve() {
  int n = s.size();
  long long mod = 1000000007;
  long long dp[105];
  dp[n] = 0;
  long long l = 1;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '0') {
      dp[i] = (2 * dp[i + 1]) % mod;
    } else {
      dp[i] = (2 * dp[i + 1] + l * l) % mod;
    }
    l = (l * 2) % mod;
  }
  cout << dp[0] << endl;
}
int main() {
  while (cin >> s) {
    solve();
  }
}
