#include <bits/stdc++.h>
using namespace std;
const int MaxN = 1005;
const int oo = 1000000000;
const long long Base = 1000000007;
typedef int Tarr[MaxN];
long long Pow(long long x, int n) {
  if (n == 0) return 1;
  long long t = Pow(x, n / 2);
  t = t * t % Base;
  if (n % 2 == 0)
    return t;
  else
    return t * x % Base;
}
int main() {
  string s;
  getline(cin, s);
  int n = s.length();
  long long Res = 0;
  for (int i = 0; i <= n - 1; i++)
    if (s[i] == '1') {
      Res = (Res + Pow(2, 2 * (n - i - 1)) * Pow(2, i) % Base) % Base;
    }
  cout << Res;
  return 0;
}
