#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y) {
  if (y == 0) return 1;
  long long d = power(x, y / 2);
  if (y % 2 == 0)
    return (d * d) % 1000000007;
  else
    return (x * ((d * d) % 1000000007)) % 1000000007;
}
char c[1000];
int main() {
  cin >> c;
  cin.ignore();
  int n = strlen(c);
  long long ans = power(2, n - 1);
  long long final = 0;
  for (int i = n - 1; i > -1; i--) {
    if (c[i] == '1') final = (final + ans) % 1000000007;
    ans = (ans * 2) % 1000000007;
  }
  cout << final << endl;
  return 0;
}
