Grease a cookie sheet and set aside. Beat butter with an electric mixer in a large mixing bowl on medium to high speed for 30 seconds, then add sugar and beat until combined, occasionally scraping the side of the bowl.
Add egg yolks and vanilla and beat into the mixture until combined, then beat in as much of the flour with the mixer as possible, stirring in the remaining flour. Cover the mixture and allow to chill for about 1 hour, or until the mixture can be easily handled.
Preheat oven to 375 degrees F. Shape the dough into 1-inch balls and roll the balls into egg whites, then coat the balls with walnuts. Place balls on the prepared cookie sheet about 1 inch apart , then press your thumb into the center of each ball.
Bake the cookies for 10 to 12 minutes, or until edges are lightly browned. Transfer cookies to a wire rack and cool. Fill the centers of the cookies with jam or preserves before serving.