#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long p) {
  long long ret = 1;
  while (p) {
    if (p % 2 == 1) {
      ret = ret * a;
      ret %= 1000000007;
    }
    a = a * a;
    a %= 1000000007;
    p /= 2;
  }
  return ret;
}
int main(void) {
  string s;
  cin >> s;
  reverse(s.begin(), s.end());
  vector<long long> dp(s.size());
  if (s[0] == '1')
    dp[0] = 1;
  else
    dp[0] = 0;
  for (int i = 1; i < s.size(); i++) {
    if (s[i] == '1') {
      dp[i] = 2 * dp[i - 1] + power(2, 2 * i);
      dp[i] %= 1000000007;
    } else {
      dp[i] = 2 * dp[i - 1];
      dp[i] %= 1000000007;
    }
  }
  cout << dp[s.size() - 1];
}
