No, OnCollisionEnter2D can only take 0 or 1 parameters and it must be a Collision2D, not a Collider2D. If the object collides with multiple objects, Unity will call upon OnCollisionEnter2D several times. Each time there will be information about the “current” collision found in the Collision2D parameter.
Thank you to all of you who replied… I found other way… I attached two different scripts to the both walls and called the functions from other script… Thank you again…