public class MyClass {
static boolean isSubset(int []arr1, int []arr2) {
int size1 = arr1.length;
int size2 = arr2.length;
int j;
for (int i = 0; i < size2; i++) {
for (j = 0; j < size1; j++) {
if (arr2[i] == arr1[j])
break;
}
if (j == size1)
return false;
}
return true;
}
public static void main(String args[]) {
int []arr1 = { 5, 1, 8, 12, 40, 7, 9, 100 };
int []arr2 = { 8, 40, 9, 1 };
if (isSubset(arr1, arr2))
System.out.println("yes");
else
System.out.println("no");
}
}
/*
run:
yes
*/