#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
long long ret;
string s;
int main() {
  cin >> s;
  for (int i = 0; i < s.size(); i++) ret = (ret * 2 + s[i] - '0') % MOD;
  for (int i = 1; i < s.size(); i++) ret = (ret * 2) % MOD;
  cout << ret;
  return 0;
}
