#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int n, m, k, t;
string s;
vector<vector<int>> edge(1000005);
int main() {
  cin >> s;
  n = s.length();
  vector<int> dis(n, 0), dp(n + 2, 0), nxt(n + 2, n);
  for (int i = 0; i < n; i++)
    if (s[i] == '0') dis[i] = (i ? dis[i - 1] : 0) + 1;
  function<int(int)> get = [&](int x) { return nxt[x] < n ? dp[nxt[x]] : 0; };
  for (int i = n - 1; i >= 0; i--)
    dp[i] = ((dis[i] <= dis.back()) + get(0) + get(dis[i] + 1)) % mod,
    nxt[dis[i]] = i;
  int ans = n;
  if (nxt[0] < n) ans = 1ll * get(0) * (nxt[0] + 1) % mod;
  cout << ans;
  return 0;
}
