#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000 * 1000 * 1000LL + 7;
long long p[110];
string s;
long long solve(int t) {
  if (!t) return 0;
  long long ans = 2 * solve(t - 1);
  if (s[t - 1] == '1') ans += p[2 * t - 2];
  return ans % MOD;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> s;
  int n = s.size();
  reverse(s.begin(), s.end());
  p[0] = 1;
  for (int i = 1; i <= 2 * n; i++) p[i] = p[i - 1] * 2 % MOD;
  cout << solve(n) << endl;
  return 0;
}
