#include <bits/stdc++.h>
using namespace std;
template <typename T>
void arrout(T arr[], int len) {
  for (int i = 0; i <= len; ++i) cout << arr[i] << " ";
  cout << endl;
}
int OK = 1;
const int INF = 0x3f3f3f3f;
const int maxn = 200200;
char s1[maxn], s2[maxn];
int pre[maxn], suf[maxn];
int arr[26][maxn];
int main() {
  scanf("%s%s", s1 + 1, s2 + 1);
  int len1 = strlen(s1 + 1);
  int len2 = strlen(s2 + 1);
  if (s1[1] != s2[1]) {
    puts("No");
    return 0;
  }
  pre[1] = 1;
  int bg = 2;
  for (int i = int(2); i <= int(len2); ++i) {
    while (bg <= len1 && s1[bg] != s2[i]) pre[bg] = pre[bg - 1], bg++;
    if (bg > len1) {
      puts("No");
      return 0;
    }
    pre[bg] = pre[bg - 1] + 1;
    bg++;
  }
  while (bg <= len1) pre[bg] = pre[bg - 1], bg++;
  if (s1[len1] != s2[len2]) {
    puts("No");
    return 0;
  }
  suf[len1] = 1;
  bg = len1 - 1;
  for (int i = int(len2 - 1); i >= int(1); --i) {
    while (bg >= 1 && s1[bg] != s2[i]) suf[bg] = suf[bg + 1], bg--;
    if (bg < 1) {
      puts("No");
      return 0;
    }
    suf[bg] = suf[bg + 1] + 1;
    bg--;
  }
  while (bg >= 1) suf[bg] = suf[bg + 1], bg--;
  for (int i = int(1); i <= int(len2); ++i) arr[s2[i] - 'a'][i] = 1;
  for (int i = int(0); i <= int(25); ++i)
    for (int j = int(1); j <= int(len2); ++j) arr[i][j] += arr[i][j - 1];
  int L, R;
  ;
  ;
  ;
  ;
  for (int i = int(2); i <= int(len1 - 1); ++i) {
    L = len2 - suf[i + 1];
    L = max(1, L);
    R = pre[i - 1] + 1;
    R = min(len2, R);
    ;
    ;
    if (L > R || arr[s1[i] - 'a'][L - 1] == arr[s1[i] - 'a'][R]) {
      puts("No");
      return 0;
    }
  }
  puts("Yes");
  return 0;
}
