#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200010;
const int INFINITE = 0x3F3F3F3F;
char s[MAXN], t[MAXN];
int dp1[MAXN], dp2[MAXN];
int MAXLEN[MAXN];
int main() {
  scanf("%s", s + 1);
  scanf("%s", t + 1);
  int n = strlen(s + 1), m = strlen(t + 1);
  int cur = 1;
  memset(MAXLEN, 0, sizeof(MAXLEN));
  memset(dp1, 0, sizeof(dp1));
  for (int i = 1; i <= n; i++) {
    if (cur <= m && s[i] == t[cur]) {
      MAXLEN[s[i]] = cur;
      cur++;
    }
    dp1[i] = MAXLEN[s[i]];
  }
  cur = m;
  memset(MAXLEN, 0, sizeof(MAXLEN));
  memset(dp2, 0, sizeof(dp2));
  for (int i = n; i >= 1; i--) {
    if (cur >= 1 && s[i] == t[cur]) {
      MAXLEN[s[i]] = m - cur + 1;
      cur--;
    }
    dp2[i] = MAXLEN[s[i]];
  }
  for (int i = 1; i <= n; i++)
    if (dp1[i] + dp2[i] <= m) {
      printf("No\n");
      return 0;
    }
  printf("Yes\n");
  return 0;
}
