#include <bits/stdc++.h>
using namespace std;
long long DP[101];
int main(int argc, char const *argv[]) {
  ios::sync_with_stdio(false);
  string str;
  cin >> str;
  reverse(str.begin(), str.end());
  if (str[0] == '0')
    DP[0] = 0;
  else
    DP[0] = 1;
  for (int i = 1; i < (int)str.length(); ++i) {
    if (str[i] == '0') {
      DP[i] = (2 * DP[i - 1]) % 1000000007;
    } else {
      long long aux = 1LL;
      for (int j = 1; j <= 2 * i; j++) {
        aux *= 2;
        aux %= 1000000007;
      }
      DP[i] = (2 * DP[i - 1] + aux) % 1000000007;
    }
  }
  cout << DP[(int)str.length() - 1] << endl;
  return 0;
}
