#include <bits/stdc++.h>
using namespace std;
int min(int x, int y) { return x < y ? x : y; }
int max(int x, int y) { return x > y ? x : y; }
int abs(int x) { return x < 0 ? -x : x; }
const int N = 200005;
const int M = 100005;
char s[N], p[N];
int mark[26][N];
int main() {
  int i, j, k = 1;
  int m, n, t;
  while (scanf("%s%s", s, p) != EOF) {
    n = strlen(s);
    m = strlen(p);
    memset(mark, 0, sizeof(mark));
    if (s[0] != p[0] || s[n - 1] != p[m - 1]) {
      printf("No\n");
      continue;
    }
    for (j = i = 0; i < n; i++)
      if (p[j] == s[i]) {
        mark[p[j] - 'a'][i]++;
        j++;
      }
    if (j != m) {
      printf("No\n");
      continue;
    }
    for (i = n - 1, j = m - 1; j >= 0 && i >= 0; i--)
      if (p[j] == s[i]) {
        mark[p[j] - 'a'][i + 1]--;
        j--;
      }
    if (j != -1) {
      printf("No\n");
      continue;
    }
    for (i = 0; i < 26; i++)
      for (j = 1; j < n; j++) mark[i][j] += mark[i][j - 1];
    for (i = 0; i < n; i++)
      if (!mark[s[i] - 'a'][i]) break;
    if (i != n)
      printf("No\n");
    else
      printf("Yes\n");
  }
  return 0;
}
