Problem: As a tradition, every year before IOI all the members of Natalia Fan Club are invited to Malek Dance Club to have a fun night together. Malek Dance Club has 2n members and coincidentally Natalia Fan Club also has 2n members. Each member of MDC is assigned a unique id i from 0 to 2n - 1. The same holds for each member of NFC.

One of the parts of this tradition is one by one dance, where each member of MDC dances with a member of NFC. A dance pair is a pair of numbers (a, b) such that member a from MDC dances with member b from NFC.

The complexity of a pairs' assignment is the number of pairs of dancing pairs (a, b) and (c, d) such that a < c and b > d.

You are given a binary number of length n named x. We know that member i from MDC dances with member <image> from NFC. Your task is to calculate the complexity of this assignment modulo 1000000007 (109 + 7).

Expression <image> denotes applying «XOR» to numbers x and y. This operation exists in all modern programming languages, for example, in C++ and Java it denotes as «^», in Pascal — «xor».

Input

The first line of input contains a binary number x of lenght n, (1 ≤ n ≤ 100).

This number may contain leading zeros.

Output

Print the complexity of the given dance assignent modulo 1000000007 (109 + 7).

Examples

Input

11


Output

6


Input

01


Output

2


Input

1


Output

1

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int bfsz = 1 << 16;
char bf[bfsz + 5];
int rsz = 0;
int ptr = 0;
char gc() {
  if (rsz <= 0) {
    ptr = 0;
    rsz = fread(bf, 1, bfsz, stdin);
    if (rsz <= 0) return EOF;
  }
  --rsz;
  return bf[ptr++];
}
void ga(char &c) {
  c = EOF;
  while (!isalpha(c)) c = gc();
}
int gs(char s[]) {
  int l = 0;
  char c = gc();
  while (isspace(c)) c = gc();
  while (c != EOF && !isspace(c)) {
    s[l++] = c;
    c = gc();
  }
  s[l] = '\0';
  return l;
}
template <class first>
bool gi(first &v) {
  v = 0;
  char c = gc();
  while (c != EOF && c != '-' && !isdigit(c)) c = gc();
  if (c == EOF) return false;
  bool neg = c == '-';
  if (neg) c = gc();
  while (isdigit(c)) {
    v = v * 10 + c - '0';
    c = gc();
  }
  if (neg) v = -v;
  return true;
}
long long gcd(long long x, long long y) { return y == 0 ? x : gcd(y, x % y); }
int toInt(char xx) { return xx - '0'; }
char toChar(int xx) { return xx + '0'; }
int isDigit(char xx) { return ('0' <= xx && xx <= '9'); }
void swapInt(int &x, int &y) {
  x = x ^ y;
  y = x ^ y;
  x = x ^ y;
}
const int dx[4] = {-1, 1, 0, 0};
const int dy[4] = {0, 0, -1, 1};
const long long Mod = 1e9 + 7;
const int maxn = 1e2 + 2;
int exitInput = 0;
int ntest = 1, itest = 1;
long long modPow(long long base, long long Exp) {
  if (Exp == 0) {
    return 1;
  }
  if (Exp == 1) {
    return base;
  }
  long long x = modPow(base, Exp / 2);
  if (Exp & 1) {
    return (x * x * base) % Mod;
  } else {
    return (x * x) % Mod;
  }
}
string s;
int n;
long long brute() {
  long long no = 0;
  long long i;
  for (i = 0; i < n; ++i) {
    if (s[i] == '1') {
      no += (1LL << (n - 1 - i));
    }
  }
  vector<pair<long long, long long> > p;
  for (i = 0; i < (1LL << n); ++i) {
    p.push_back(pair<long long, long long>(i, (i ^ no)));
  }
  long long j;
  long long ret = 0;
  for (i = 0; i < (1LL << n); ++i) {
    for (j = i - 1; j >= 0; --j) {
      if (p[i].second < p[j].second) {
        ret++;
      }
    }
  }
  return ret;
}
void read() {
  if (!(cin >> s)) {
    {
      exitInput = 1;
      return;
    };
  }
  n = s.size();
}
void init() {
  int i, j;
  long long ret = 0, x, y;
  for (i = 0; i < n; ++i) {
    if (s[i] == '1') {
      j = n - 1 - i;
      x = modPow(2, i);
      y = modPow(2, j);
      y = (y * y) % Mod;
      ret += (x * y) % Mod;
      ret %= Mod;
    }
  }
  cout << ret << endl;
}
void solve() {}
int main() {
  clock_t t1, t2;
  t1 = clock();
  ios_base::sync_with_stdio(0);
  for (itest = 1; itest <= ntest; ++itest)
    for (itest = 1;; ++itest) {
      read();
      if (exitInput) {
        break;
      }
      if (itest > 1) {
      }
      init();
      solve();
    }
  t2 = clock();
  return 0;
}