#include <bits/stdc++.h>
using namespace std;
int n;
long long dp[1000005], last1, t, v, mod = 1e9 + 7;
string s;
struct nibab {
  long long s, l, v;
};
stack<nibab> q;
int32_t main() {
  ios_base ::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  cin >> s;
  n = s.length();
  for (int i = 1; i <= n; i++) {
    if (s[i - 1] == '0') {
      t++;
      if (last1)
        dp[i] = dp[last1];
      else
        dp[i] = 1;
      if (i > 1 && s[i - 2] == '0') dp[i] = (dp[i] + dp[i - 1]) % mod;
      while (q.size() && t >= q.top().s) v -= q.top().v, q.pop();
      if (q.size()) {
        v -= q.top().v;
        q.top().v = dp[q.top().l - t];
        v += q.top().v;
      }
      v += dp[i];
      v = (v % mod + mod) % mod;
      q.push({t, i, dp[i]});
    } else {
      if (!last1 && q.size()) q.pop();
      t = 0;
      dp[i] = (dp[last1] + v + 1) % mod;
      last1 = i;
    }
  }
  if (s[n - 1] == '0')
    cout << (dp[last1] + dp[n]) % mod << '\n';
  else
    cout << dp[last1] << '\n';
}
