#include <bits/stdc++.h>
using namespace std;
const int c = 1000002;
string s;
long long n, dp[c], kom[c], lp[c], pos, sum = 1, e, db = 1, cnt,
                                        mod = 1000000007;
int main() {
  cin >> s, n = s.size();
  while (s[pos] == '0') pos++, dp[pos] = 1, sum++;
  if (pos == n) {
    cout << n;
    return 0;
  }
  while (pos < n) {
    pos++, dp[pos] = sum, kom[pos] = dp[pos] + kom[pos - 1], cnt = 0;
    while (pos < n && s[pos] == '0')
      cnt++, pos++, kom[pos] = kom[pos - 1],
                    dp[pos] = (kom[pos] - kom[lp[cnt]] + mod) % mod,
                    sum += dp[pos], sum %= mod, lp[cnt] = pos;
  }
  sum = 0;
  while (pos > 0) {
    if (s[pos - 1] == '1') e++, sum += dp[pos];
    if (!e) db++;
    pos--;
  }
  cout << sum * db % mod << "\n";
  return 0;
}
