#include <bits/stdc++.h>
using namespace std;
string s;
long long P[110];
int N;
long long F(int pos) {
  if (pos == -1) return 0;
  if (s[pos] == '1') return (P[pos] + (2LL * F(pos - 1))) % 1000000007LL;
  return (2LL * F(pos - 1)) % 1000000007LL;
}
int main() {
  P[0] = 1;
  for (int i = 0; i < (int)110; i++)
    if (i >= 1) P[i] = (P[i - 1] * 4LL) % 1000000007LL;
  long long ans;
  cin >> s;
  N = s.size();
  reverse(s.begin(), s.end());
  ans = F(N - 1);
  cout << ans << endl;
  return 0;
}
