Generate a Python program that has the following intention:

The intention of the program below is to create a recursive function, p1(arr), that generates a flattened list from a given nested list (arr). The function iterates through the elements of the input list and checks if the element is a list or not. If the element is a list, it recursively calls p1 on the nested list, and if not, it yields the element itself. The function then yields all the results obtained from the recursive calls and the non-list elements.