#include <bits/stdc++.h>
using namespace std;
char s[1000010];
const int mod = 1e9 + 7;
int dp[1000010], sum;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  int n = strlen(s);
  int l = 0;
  while (s[l] == '0') l++;
  int ans = l + 1;
  int r = n - 1;
  while (r >= l && s[r] == '0') r--;
  ans = 1ll * ans * (n - r) % mod;
  if (l <= r) {
    sum = 1;
    for (int i = l + 1; i <= r;) {
      int j = i;
      while (j < r && s[j] == '0') j++;
      int x = j - i;
      int prv = sum;
      for (int k = 0; k <= x; k++) {
        sum = (sum - dp[k]) % mod;
        dp[k] = prv;
        sum = (sum + dp[k]) % mod;
      }
      if (sum < 0) sum += mod;
      i = j + 1;
    }
    ans = 1ll * ans * sum % mod;
  } else {
    ans--;
    if (ans < 0) ans += mod;
  }
  cout << ans;
}
