How to pass –build-arg parameters from command line to docker-compose.yml file?

Suppose that I type the following command

docker-compose -f docker-compose.yml build --build_args PARAM=1

How should I write my docker-compose.yml such that the yml fiel gets the argument PARAM, whose value is 1?

My yml file is below.

version: '3.7'

services:
  web:
    build:
      context: .
      dockerfile: ./Dockerfile
      args: 
         - MY_PARAM: ${PARAM}
      ports:
         - "5000:5000"
    image: sample-img:1.0

I added

args: 
   - MY_PARAM: ${PARAM}

below build. Is this correct?

Source: StackOverflow