#include <bits/stdc++.h>
using namespace std;
string s;
long long pot(int n) {
  if (n == 0) return 1;
  return (4 * pot(n - 1)) % 1000000007;
}
long long f(int pos) {
  if (pos == -1) return 0;
  if (s[pos] == '1')
    return (pot(pos) % 1000000007 + 2 * f(pos - 1) % 1000000007) % 1000000007;
  return 2 * f(pos - 1) % 1000000007;
}
string a;
int main() {
  cin >> a;
  for (int i = 0; i < a.length(); i++) s = a[i] + s;
  cout << f(s.length() - 1) << endl;
  return 0;
}
