#include <bits/stdc++.h>
using namespace std;
bool solve(string &A, string &B) {
  int prefix[200007], suffix[200007], len1 = A.length(), len2 = B.length(),
                                      prev[200007];
  memset(prev, -1, sizeof prev);
  for (int i = 0, j = 0; i < len1; i++) {
    if (j < len2 && A[i] == B[j])
      prefix[i + 1] = j + 1, prev[A[i]] = j + 1, j++;
    else
      prefix[i + 1] = prev[A[i]];
  }
  memset(prev, -1, sizeof prev);
  for (int i = len1 - 1, j = len2 - 1; i >= 0; i--) {
    if (j >= 0 && A[i] == B[j])
      suffix[i + 1] = j + 1, prev[A[i]] = j + 1, j--;
    else
      suffix[i + 1] = prev[A[i]];
  }
  for (int i = 1; i <= len1; i++) {
    if (prefix[i] == len2 || suffix[i] == 1) continue;
    if (prefix[i] != -1 && suffix[i] != -1 && prefix[i] >= suffix[i])
      continue;
    else
      return false;
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  string A, B;
  cin >> A >> B;
  if (solve(A, B))
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
