#include <bits/stdc++.h>
using namespace std;
vector<char> v;
long long Pow[1000];
int main() {
  string s;
  cin >> s;
  for (int i = 0; i < s.length(); i++) v.push_back(s[i] - '0');
  Pow[0] = 1;
  for (int i = 1; i <= s.length() * 3; i++)
    Pow[i] = Pow[i - 1] * 2 % (1000 * 1000 * 1000 + 7);
  long long ans = v.back();
  for (int i = v.size() - 2; i >= 0; i--)
    if (v[i])
      ans =
          (ans * 2 + Pow[2 * (s.length() - i - 1)]) % (1000 * 1000 * 1000 + 7);
    else
      ans = ans * 2 % (1000 * 1000 * 1000 + 7);
  cout << ans << endl;
  cin >> ans;
}
