#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
const int maxm = 30;
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
int n, m;
char s[maxn];
long long POW(long long a, long long b) {
  if (!b) return 1;
  long long c = POW(a, b >> 1);
  c = (c * c) % mod;
  if (b & 1) {
    c = (c * a) % mod;
  }
  return c;
}
int f(int k) {
  if (k == n - 1) {
    if (s[k] == '0')
      return 0;
    else
      return 1;
  }
  if (s[k] == '0')
    return (2 * f(k + 1)) % mod;
  else
    return ((2 * f(k + 1)) % mod + POW(4, n - k - 1)) % mod;
}
int main() {
  int i, j;
  scanf("%s", s);
  n = strlen(s);
  printf("%d\n", f(0));
  return 0;
}
