#include <bits/stdc++.h>
using namespace std;
long long ans = 0;
vector<pair<long long, long long> > stk = {{(1 << 29), 0}};
vector<int> run_length;
char s[1100000];
int main() {
  scanf("%s", s);
  int n = strlen(s);
  int zero_cnt = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '0')
      zero_cnt++;
    else {
      run_length.push_back(zero_cnt);
      zero_cnt = 0;
    }
  }
  if (run_length.empty()) {
    cout << zero_cnt << endl;
    return 0;
  }
  for (auto l : run_length) {
    if (stk.back() == pair<long long, long long>((1 << 29), 0)) {
      stk.push_back({l, l + 1});
      continue;
    }
    long long last = -1;
    long long val = 0;
    long long merged = 0;
    while (stk.back().first < l) {
      (val += stk.back().second * (l - last) % 1000000007) %= 1000000007;
      (merged += stk.back().second) %= 1000000007;
      last = stk.back().first;
      stk.pop_back();
    }
    (val += stk.back().second * (l - last) % 1000000007) %= 1000000007;
    (stk.back().second += merged) %= 1000000007;
    stk.push_back({l, val});
  }
  for (auto x : stk) (ans += x.second) %= 1000000007;
  (ans *= 1 + zero_cnt) %= 1000000007;
  cout << ans << endl;
  return 0;
}
