#import <Foundation/Foundation.h>
typedef long long Int;
int main() {
  @autoreleasepool {
    NSMutableArray *a = [NSMutableArray array];
    Int n;
    scanf("%lld", &n);
    for (Int i = 0; i < n; i++) {
      Int x;
      scanf("%lld", &x);
      [a addObject:@(x)];
    }
    scanf("%lld", &n);
    for (Int i = 0; i < n; i++) {
      Int x;
      scanf("%lld", &x);
      Int index = [a indexOfObject:@(x)];
      if (index == NSNotFound) {
        puts("NO");
        return 0;
      }
      [a removeObjectAtIndex:index];
    }
    puts("YES");
  }
}