#include <bits/stdc++.h>
using namespace std;
const int N = 1000010;
int n;
char s[N];
int cur[N], sum = 0, dp[N];
vector<int> v;
int main() {
  scanf("%s", s);
  n = strlen(s);
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '1') {
      if (i != 0) v.push_back(cnt);
      cnt = 0;
    } else
      cnt++;
  }
  v.push_back(cnt);
  dp[(int)v.size() - 1] = v.back() + 1;
  if ((int)v.size() == 1) {
    if (s[0] == '0') {
      cout << n << endl;
    } else
      cout << n + 1 << endl;
    return 0;
  }
  for (int i = (int)v.size() - 2; i >= 0; i--) {
    for (int j = 0; j <= v[i]; j++) {
      sum -= cur[j];
      if (sum < 0) sum += 1000000007;
      cur[j] = dp[i + 1];
      sum += cur[j];
      if (sum >= 1000000007) sum -= 1000000007;
    }
    if (i == 0 && s[i] == '0') {
      dp[i] = (long long)(v[i] + 1) * dp[i + 1] % 1000000007;
      break;
    }
    dp[i] = sum;
    if (i < (int)v.size() - 1) {
      dp[i] += dp[(int)v.size() - 1];
      if (dp[i] >= 1000000007) dp[i] -= 1000000007;
    }
    if (i == 0 && s[i] == '0') {
      dp[i]--;
      if (dp[i] < 0) dp[i] += 1000000007;
    }
  }
  cout << dp[0] << endl;
  return 0;
}
