#include <bits/stdc++.h>
using namespace std;
long long ans = 0;
char s[(100 + 10)];
long long sqr(long long a) { return a * a % (1000000007); }
long long bin[1000];
int main() {
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  bin[0] = 1;
  for (int i = 1; i <= 999; i++) bin[i] = (bin[i - 1] * 2) % (1000000007);
  for (int i = 1; i <= n; i++)
    if (s[i] == '1')
      ans =
          (ans + (bin[i - 1]) % (1000000007) * sqr(bin[n - i])) % (1000000007);
  cout << ans << endl;
  return 0;
}
