#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int P = int(1e9) + 7;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  string str;
  cin >> str;
  int n = int((str).size());
  if (str == string(n, '0')) {
    cout << n << '\n';
    return 0;
  }
  int s = 0;
  while (str[s] == '0') s++;
  int f = n - 1;
  while (str[f] == '0') f--;
  vector<int> zeroes;
  for (int i = int(s); i < int(f); i++) {
    assert(str[i] == '1');
    int j = i + 1;
    while (str[j] == '0') j++;
    j--;
    zeroes.push_back(j - i);
    i = j;
  }
  int zero = int((zeroes).size()) + 1;
  vector<int> dp(zero);
  dp[0] = 1;
  vector<int> pref{0, 1};
  for (int i = int(1); i < int(zero); i++) {
    dp[i] = 1ll * dp[i - 1] * (zeroes[i - 1] + 1) % P;
    int sufMax = INT_MIN;
    for (int j = i - 2; j >= 0; j--) {
      sufMax = max(sufMax, zeroes[j]);
      if (sufMax >= zeroes[i - 1]) break;
      dp[i] += 1ll * (zeroes[i - 1] - sufMax) * dp[j] % P;
      if (dp[i] < 0) dp[i] += P;
      if (dp[i] >= P) dp[i] -= P;
    }
    pref.push_back((pref.back() + dp[i]) % P);
  }
  cout << 1ll * pref.back() * (s + 1) % P * (n - f) % P << '\n';
}
