#include <bits/stdc++.h>
using namespace std;
char str[110];
long long a[110], f[110];
int n;
int main() {
  memset(f, 0, sizeof(f));
  memset(str, 0, sizeof(str));
  cin.getline(str, 110);
  for (n = 0; str[n]; n++)
    ;
  a[0] = 1;
  n--;
  for (int i = 1; i <= n; i++) a[i] = (a[i - 1] * 2) % 1000000007;
  if (str[n] == '1') f[0] = 1;
  for (int i = 1; i <= n; i++)
    if (str[n - i] == '0')
      f[i] = (f[i - 1] * 2) % 1000000007;
    else
      f[i] = (f[i - 1] * 2 + a[i] * a[i]) % 1000000007;
  cout << f[n];
  return 0;
}
