#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-11;
template <class T>
inline void checkmin(T &a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void checkmax(T &a, T b) {
  if (b > a) a = b;
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
const int maxn = 200000 + 5;
int n, m;
char a[maxn], b[maxn];
int f1[maxn], f2[maxn];
int s[26][maxn];
void prepare(int f[]) {
  int L = 0;
  f[0] = 0;
  for (int i = 1; i <= n; i++) {
    if (L < m && b[L + 1] == a[i]) L++;
    f[i] = L;
    if (f[i] == m) f[i] = m - 1;
  }
}
bool solve() {
  n = strlen(a + 1);
  m = strlen(b + 1);
  prepare(f1);
  reverse(a + 1, a + n + 1);
  reverse(b + 1, b + m + 1);
  prepare(f2);
  reverse(f2 + 1, f2 + n + 1);
  reverse(a + 1, a + n + 1);
  reverse(b + 1, b + m + 1);
  memset(s, 0, sizeof(s));
  for (int c = 0; c < 26; c++)
    for (int i = 1; i <= m; i++) s[c][i] = s[c][i - 1] + (int)(b[i] == c + 'a');
  for (int i = 1; i <= n; i++) {
    if (f1[i - 1] + f2[i + 1] < m - 1) return false;
    if (s[a[i] - 'a'][f1[i - 1] + 1] == s[a[i] - 'a'][m - f2[i + 1] - 1])
      return false;
  }
  return true;
}
int main() {
  while (scanf("%s%s", a + 1, b + 1) != -1)
    if (solve())
      printf("Yes\n");
    else
      printf("No\n");
  return 0;
}
