How to check if touch I made is over a specific gameobject?

I was looking to draw a line on the screen.I only want to draw on the specific area of the screen .So how can I set if I could draw only on specific area. Drawing area(which is also UI) which is at the centre. That is when Drawing the lines with touch I want only to draw on the centre area avoiding the two sides.

 if (!EventSystem.current.IsPointerOverGameObject(Input.GetTouch(0).fingerId))
{

// if touch is only on the central part then draw.

  }

I would instead add a script to the central drawing area game object which implements the IPointClickHandler interface - this would intercept clicks/taps made on that object. You can then pass that information to a more general input controller class to decide what to do with it.

using UnityEngine.EventSystems;

public class DrawingArea : Monobehavior, IPointerClickHandler
{
    public void OnPointerClick(PointerEventData pointerEventData)
    {
        Debug.Log("Clicked on the drawing area!");
    }
}