Generate a Python program that has the following intention:

The intention of the program is to recursively traverse a given list, arr, and yield the elements of the list that are not already within a list.

The program uses a while loop to iterate through the elements of the list arr. For each element, it checks if it is not already within a list using the isinstance() function. If the element is not within a list, the program yields the result of calling the p1() function on that element.

If the element is within a list, the program calls the p1() function on the nested list, and then yields each element of the nested list.

The program then increments the index i to move to the next element in the list.

Overall, the program is designed to flatten a nested list, by recursively yielding the elements of the list that are not already within a list.